Practical guides¶
These guides are task-oriented. Each one shows the Python declaration, the generated Android behavior and the part that remains under application control.
For a single continuous path through installation, a real two-screen app, Previewer validation and Android generation, follow the end-to-end Knowledge Vault tutorial.
Models, indexed queries, transactions and explicit migrations.
01API-backed feedPagination, refresh, retry and optimistic rows.
02Real-time chatWebSocket lifecycle, pending sends and reconnect.
03Firebase pushToken, topics, foreground events and Android setup.
04Spotify-style audioBackground service, playlists and lock-screen controls.
05SQLite and encryptionLegacy SQL, protected values and security boundaries.
06Streaming uploadsMultipart progress, cancellation and result handling.
07Maps and trackingDevice location, preview simulation and calculated routes.
08Offline work queuePersistent jobs, constraints, retries and observable progress.
09Knowledge appMarkdown, inline spans, trees and local documents.
10Sensors and batteryEight sensor APIs, callback contracts, complete apps and the 1.7.0 additions.
11Static wallpapersChoose an image, preview it, confirm the target and handle cancellation.
12Persistent notificationsChannels, actions, expanded cards, progress and the in-device Previewer drawer. New in 1.7.0.
13NFC tagsRead text and links, write a spare tag, handle failures and simulate tags inside the Previewer. New in 1.9.0.
14ContactsChoose one detail, search with permission and use native editors. Complete People Desk app and fictional desktop data. New in 1.9.0.
15Your own JavaDeclare a Java block with the answer the Previewer gives instead, plus the Gradle dependency, manifest entry and R8 rule around it. New in 1.9.0; from 1.13.0 the block can be Python.
16The rest of the phoneHaptics, speech, a web page, files, downloads, the calendar, the dialler, recording, printing, links and shares. New in 1.13.0.
17Outside the appA home-screen widget, a quick settings tile, AdMob, updates through Play and Health Connect. New in 1.13.0.
18TimersA function run later, or again and again, while its screen is on show. New in 1.13.0.
19The connectionOnline or not, over what, and being told when it changes. New in 1.13.0.
20The displayKeep the screen on, set its brightness, hide the bars and choose which way up. New in 1.13.0.
21The app lockLock the app after a while away; the phone's own fingerprint, face or screen lock opens it. New in 1.13.0.
How to use a guide¶
- Copy the smallest example into
writehere.py. - Confirm callbacks and layout in the Hot Previewer.
- Run
apkpy build. - Open the generated project in Android Studio.
- Test platform behavior on an emulator and a physical device.
The Previewer is a fast development surface. Permission dialogs, codecs, background restrictions, Firebase and GPS must still be validated on Android.