On this page
Most free QR apps open a full-screen ad before they show you the link. This brief is for a clean scanner that decodes on the phone, keeps a history of everything scanned, and asks before opening any URL. Android is the best-fit first build: CameraX and ML Kit barcode scanning are mature and need no network. On iPhone the same idea works with VisionKit’s live scanner, and building it needs a Mac with Xcode. The first proof is one real printed QR code: scan it, see the decoded text and the domain, choose Open, and find the scan in History after reopening the app.
Screens
- Scan: Live camera with a framing guide, torch toggle and a pause after each successful read.
- Result: Decoded content with its type (link, Wi-Fi, contact, text), the domain shown large, and Open, Copy or Share.
- History: Every scan with time and type, searchable and deletable one by one or all at once.
- Scan from image: Decode a QR code from a screenshot picked with the photo picker.
- Settings: Auto-open off by default, vibration on scan and history retention.
Data model
| Table | Key fields | Purpose |
|---|---|---|
| scans | id (uuid), raw_value (text), format (text), content_type (text), scanned_at (timestamptz) | The exact decoded payload and what kind of code it was. |
| scan_actions | id (uuid), scan_id (uuid), action (text: opened, copied, shared), at (timestamptz) | What the user chose to do, so History can show which links were actually opened. |
| settings | auto_open (bool), keep_days (int), haptic (bool) | Behaviour the owner controls, stored locally. |
Everything lives in local storage; the scanner needs no account and no server. Decoding runs on-device, so a code that holds a Wi-Fi password or a contact card is never sent anywhere. A link is only fetched when the user taps Open, and then by the system browser rather than an in-app web view. Retention is the owner’s choice, and Clear history must remove rows rather than hide them.
Native features
The camera pipeline and the safety of the Result screen matter more than visual polish. A scanner that fires the same link five times because the code stayed in frame is a broken scanner.
| Feature | Android (Kotlin) | iPhone (SwiftUI) | Notes |
|---|---|---|---|
| Live decoding | CameraX ImageAnalysis with ML Kit barcode scanning (on-device) | VisionKit DataScannerViewController | Stop analysing after the first stable read until the user returns to Scan. |
| Decode from an image | ML Kit InputImage from a picked Uri | Vision VNDetectBarcodesRequest on the picked image | Lets someone scan a code sent as a screenshot. |
| Wi-Fi codes | WifiNetworkSuggestion with user approval | NEHotspotConfiguration join request | Show the network name first; join only after an explicit tap. |
Android notes (Kotlin and Jetpack Compose)
Host the CameraX PreviewView inside an AndroidView and bind ImageAnalysis with STRATEGY_KEEP_ONLY_LATEST. When ML Kit returns a value, set a ViewModel state to Result and unbind analysis so repeated frames cannot create duplicate history rows.
- Request camera permission with rememberLauncherForActivityResult; on denial, keep Scan from image fully usable and explain how to re-enable the camera.
- Parse the payload into a sealed class (Url, Wifi, Contact, Text). For URLs, show the host in large type and flag http links and lookalike punycode domains before the Open button.
- Emulators rarely give a useful camera, so test on a real Android phone: scan a printed code with the torch in dim light, hold it in frame for five seconds and confirm one History row, then scan a screenshot from the gallery.
iPhone notes (Swift and SwiftUI)
Wrap DataScannerViewController in a UIViewControllerRepresentable, restrict recognized data types to barcodes with the QR symbology, and stop scanning in the delegate on the first item. Check DataScannerViewController.isSupported and fall back to image decoding on older devices.
- Store scans and actions with SwiftData and present Result as a sheet with medium detent, so the camera stays visible behind it for the next scan.
- Open links with the openURL environment action after the user taps, never automatically, and add NSCameraUsageDescription that says decoding happens on the phone.
- The iOS Simulator has no camera; test live scanning on a physical iPhone. Deny camera access and confirm the picked-image path still decodes a QR code screenshot.
Copy-paste prompt
Every free QR app I try opens an ad before the link. Build me a clean QR scanner for Android with no ads that keeps a history of every code I scan and opens links only after I say ok. Screens: Scan, Result, History, Scan from image, Settings. Decode on the phone with ML Kit or VisionKit, with no network needed. After one good read, pause scanning so the same code is not saved five times. On Result show the type (link, Wi-Fi, contact or text), show the link’s domain big, warn on plain http, and give Open, Copy and Share; open links in the system browser. Let me pick a screenshot and decode the QR in it. Save history locally with search and delete, and auto-open off by default. Handle camera permission denied, no code found, a damaged code, and dim light with a torch button. Tell me what needs a real phone to test.
Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.
Acceptance test
- Scan a printed QR code containing a URL and confirm the Result screen shows the domain without opening anything.
- Keep the code in frame for several seconds and confirm History has exactly one new row.
- Tap Open and confirm the system browser loads the link and History records the action as opened.
- Pick a screenshot containing a QR code and confirm it decodes with the camera permission denied.
- Scan a Wi-Fi QR code and confirm the app asks before joining and shows the network name first.
Clear history and reopen the app: the list should be empty and the database rows gone. Then scan a code that contains plain text longer than the screen, and one that is not a QR code at all, such as a product barcode; the app should show the text in a scrollable view and either decode the barcode honestly or say it only reads QR codes.
Frequently asked questions
Does scanning send my codes to a server?
No. Decoding happens on the phone with an on-device library, and a link is only visited when you tap Open in the system browser.
Can it create QR codes too?
Generating codes is a small follow-up prompt: add a Create tab that renders text or a link into a QR image you can share. Keep it separate so the first release stays focused.
How is this different from the inventory blueprint?
The inventory brief uses barcode scanning as one step in stock movements. This one is a general scanner whose whole job is reading codes safely and keeping a history.
Build this blueprint
The blueprint prompt, ready for your platform. Edit anything before you send it.
Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.