Skip to content
TriedPrompts

More in Build apps & tools.

Build an offline scam-warning app for a parent's phone with Gemma

A developer's offline Android app with Gemma caught all 10 test scams, after a first prompt flagged 9 of 10 normal messages too.

Result: WorkedTool: GemmaLevel: AdvancedSetup: Needs GitHub

Copy the prompt

Outcome

After Golor Abraham AjiriOghene's mother, a shop owner in Nigeria, got a first smartphone, fake WhatsApp and SMS promos kept arriving and were forwarded to the developer to check. Over a weekend the developer built ScamGuard, an Android app that runs Google's open Gemma 3 1B model on the phone itself, with no internet permission at all. Against 20 test messages, a first prompt describing local scams caught 9 of 10 scams but also called 9 of 10 normal messages scams, and asking Gemma simple yes-or-no questions did worse. What worked: rules catch the sure-fire patterns first (a link plus "your BVN is blocked", a request for a code or PIN, a prize with a fee, money for a "new number"), Gemma judges the rest, and its "scam" verdict only stands if the message has a link, a phone number or a request for money or a code. Gemma's own explanations were often made up, so the app shows warnings the developer wrote. That caught all 10 test scams with no false loud alarm; on 20 unseen messages it missed 3, which new rules fixed. Clear scams turn the screen red with a spoken English or Pidgin warning in about 2 seconds, and Gemma checks take about 5–8 seconds on a Pixel 8. The developer's mother was very happy with it. It doesn't check calls, photos or voice notes yet.

Evidence: Described by posterThe person describes what happened in words, without screenshots or video.

WorkedEvidence: Described by posterPosted Last checked

Level: Advanced. You need: A tool that takes actions for you or writes code, connected accounts, or some setup on your computer.

How to use this

  1. Tap Copy prompt.
  2. Open the tool the case used (or a similar one) and paste the prompt; results may differ from the original.
  3. Paste it into the message box.
  4. Replace anything in [CAPITAL LETTERS IN BRACKETS] with your own details.
  5. Send it, then read the answer before acting on it.
New to this? What's a prompt?

A prompt is the message you send to the AI tool. Copy the one on this page, put your own details where it asks, and read the answer before you act on it.

Prompt

Recreated prompt

The source didn't share its exact prompt, so we wrote one from what it describes. The result shown is the source's, not ours.

What the prompt labels mean

The person didn't share their exact words, so we wrote this from what they described. We haven't tested it, and they didn't use this exact version.

I'm building an Android app that checks incoming SMS and WhatsApp messages for scams on the phone itself with [ON-DEVICE MODEL]. Here are my test messages, half scams and half normal: [TEST MESSAGES]. Help me design the checks so clear scams are caught by simple rules first, the model decides the rest, and a model "scam" verdict only counts when the message contains a link, a phone number, or a request for money or a code. For each version, report how many scams were caught and how many normal messages were wrongly flagged.

Try this in:

This prompt has blanks to fill in, like [ON-DEVICE MODEL]. We'll copy it instead of filling it in, so you can edit it before you send.

The source used Gemma. These are general chat tools, so results may differ.

Opens in a new tab. We don't see what you send.

These links are only a shortcut. We're not affiliated with OpenAI, Google, Anthropic or xAI, and your results may not match the source.

Optional stronger version

Our rewrite with extra checks. The poster didn't test it.

Before you start, ask me 1–3 short questions about the details below and wait for my answers. Once I've answered, confirm the plan in one line and run the whole task start to finish.

Goal: Build and test the message checks for an offline scam-warning app on a parent's phone.

Questions to ask me first:
- Which messaging apps should it watch, and in which languages?
- Which on-device model will it run, and on what phone?
- What should the parent see or hear when a scam arrives?

Inputs (fill in or confirm):
- On-device model: [MODEL]
- Test set: [10 SCAMS AND 10 NORMAL MESSAGES]
- Scam types seen locally: [SCAM TYPES]
- Warning style and language: [WARNING]

Rules:
- Catch sure-fire scam patterns with plain rules before the model sees the message.
- Only accept the model's "scam" verdict if the message has a link, a phone number, or a request for money or a code.
- Never show the model's own explanation to the parent; use fixed warning text.
- Keep everything on the phone; the app must not need internet access.

Checkpoint: Show me the rules list and the results on the test set before tuning anything else.

If you get stuck: If the model flags most normal messages, stop and change the design, not just the prompt wording.

Verify before you finish: Run a second set of unseen messages and list every miss and false alarm.

Output: The rules, the model prompt, and a results table for both test sets.

Done when: Every test scam is caught and no normal message sets off the loud warning.

AI tool

Gemma

Source

Posted
by Golor Abraham AjiriOghene (DEV Community)
Last checked
Method:
How we verify

https://dev.to/abrahamgolor/i-built-an-offline-ai-that-warns-my-mum-about-scam-messages-3p58

Context: Firsthand DEV Community post dated October 5, 2026, entered in a Hacktoberfest weekend challenge, with a demo video and the code on GitHub. All results are from the developer's own tests. The prompt is recreated and untested. The warning voice clips were made with ElevenLabs and play offline. The app isn't on the Play Store yet and needs a 64-bit phone with about 2.3 GB free during setup.

Tell us how it went A reader message. It is not published on this page, and it is not a test of the prompt.

More in Build apps & tools

More in CodingRandom case in Coding