DEV Community

Jayana  Gunaweera
Jayana Gunaweera

Posted on

Cleanup Walk: an Android app that turns screen time into a neighborhood cleanup.

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

You tap "30-minute cleanup" (or 15, 45, 60), and the app plans a walking loop that routes you past known problem spots nearby. You pick up litter, snap photos of what you find, and at the end you get a summary like:

You cleaned 1.8 km of your neighborhood and removed 14 pieces of litter.

The app's job isn't to keep you scrolling. It exists to get you out the door and hand you something useful to do once you're there.

  • Spots problems with the camera. Take a photo and an on-device model finds litter, overflowing bins, damaged public infrastructure, and fallen branches, with a count. You confirm or correct with one tap.
  • Plans a time-boxed route. Spots with damaged infrastructure and overflowing bins are weighted highest. Any spare time becomes exploration stops in a new direction, so you find new problems.
  • Guides the walk. It shows time left, distance walked, litter removed, and the direction to the next stop. A big +1 litter button counts everything you pick up along the way.
  • Remembers. Open issues are saved so future walks route past them, and lifetime totals show on the home screen.

Who it's for: anyone who wants a reason to walk and leave the block a bit better than they found it. That includes people who care about their neighborhood but never know where to start.

It works fully offline. There's no account, server, API key, or Google Play Services dependency, and photos never leave the phone.

Home Walk in progress AI detection Summary

Code

Cleanup Walk

An Android app that turns screen time into a neighborhood cleanup.

Pick "30-minute cleanup", follow a walking loop that prioritizes places with visible problems, pick up litter or report what you find, and at the end:

You cleaned 1.8 km of your neighborhood and removed 14 pieces of litter.

The app's job isn't to entertain you — it converts screen interaction into physical action.

Screenshots

1 · Home 2 · Choose a duration 3 · Walk in progress
Home screen Choose how long to clean Walk screen with timer, distance, litter count and direction to the next stop
Start a walk or scan an issue; open issues listed below. 15, 30, 45 or 60 minutes. The app gets your location and plans the loop. Time left, distance, litter count, and an arrow to the next problem spot.
4 · At a problem spot 5 · Scan 6 · AI suggestion
Arrived at a litter spot, choosing how many pieces were picked up Camera photo of litter Detected litter x3, 91% sure
"Done here" asks how many pieces you picked up. Take a photo; the on-device model finds the
…

How I Built It

Open-source AI: Gemma 3n E2B. It's Google's open-weight multimodal model, running entirely on the phone through LiteRT-LM (Apache 2.0). Each scan sends the camera photo plus a fixed prompt, and Gemma replies in a strict, parseable format:

litter: 3
overflowing_bin: 0
damaged_infrastructure: 1
fallen_branch: 0
main: litter
confidence: high
Enter fullscreen mode Exit fullscreen mode

A few design decisions I'm happy with:

  • Forgiving parsing. Small models don't always follow the format perfectly. GemmaScan.kt holds the prompt and a parser that copes with markdown, odd casing, and missing lines, all covered by unit tests.
  • Deterministic output. Sampling is set to topK = 1, temperature = 0.1, and every scan uses a fresh conversation so photos don't influence each other.
  • Model stays loaded. The first scan loads the engine (a few seconds) and it's kept for the session. The vision encoder runs on the GPU when available and falls back to the CPU.
  • Swappable model. The .litertlm file is imported at runtime (â‹® → Import Gemma model), so you can try Gemma 3n E4B or a fine-tune without rebuilding.
  • AI suggests, human confirms. The model's answer comes first, and one tap confirms or corrects it.

The route planner is plain Kotlin, not AI. Choosing spots within a time limit is an orienteering problem, so the planner:

  1. Scores each issue: priority × (1 + ln(count)) × freshness, where freshness halves every 14 days.
  2. Keeps only issues reachable and returnable within the budget.
  3. Greedily inserts the best score-per-extra-second issue, improving the loop with 2-opt after each insertion.
  4. Fills leftover time with an octagonal exploration loop heading away from visited issues.

Stack: Kotlin, Jetpack Compose, Room, platform LocationManager, and LiteRT-LM. About 3,000 lines of Kotlin.

Tests

The core logic is pure Kotlin, so it's covered by unit tests that run in CI on every push to main:

  • Route planner: includes a randomized test that the estimated time never exceeds the time you chose
  • Gemma reply parser: markdown, odd casing, and missing lines
  • Walk manager and distance tracking: walks survive the app being closed
  • Domain model: scoring, freshness, and issue handling

Passing CI run: ./gradlew testDebugUnitTest assembleDebug, which also builds the debug APK.

./gradlew testDebugUnitTest
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

A cleanup app is only useful if people actually trust it with their camera and location, and that's where open weights changed the design.

  • Privacy by architecture. Because Gemma 3n runs on the device, photos are analyzed locally and deleted right after. There's no server to leak from and no upload policy to trust.
  • Works where the problems are. Litter and broken bins are often in places with poor signal. A closed vision API would have made the core feature useless exactly where it's needed.
  • No keys, no bills, no accounts. A free community tool can't carry per-photo API costs, and every user would need an account or key. With open weights the marginal cost of a scan is zero.
  • Swappable and improvable. The model is just a file. Anyone can drop in a bigger Gemma, or a version fine-tuned on their own city's litter and signage, with no rebuild.

Prize Categories

  • Gemma (Gemma 3n E2B running on-device via LiteRT-LM)

Top comments (0)