Skip to content

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.

00Typed local data

Models, indexed queries, transactions and explicit migrations.

01API-backed feed

Pagination, refresh, retry and optimistic rows.

02Real-time chat

WebSocket lifecycle, pending sends and reconnect.

03Firebase push

Token, topics, foreground events and Android setup.

04Spotify-style audio

Background service, playlists and lock-screen controls.

05SQLite and encryption

Legacy SQL, protected values and security boundaries.

06Streaming uploads

Multipart progress, cancellation and result handling.

07Maps and tracking

Device location, preview simulation and calculated routes.

08Offline work queue

Persistent jobs, constraints, retries and observable progress.

09Knowledge app

Markdown, inline spans, trees and local documents.

10Sensors and battery

Eight sensor APIs, callback contracts, complete apps and the 1.7.0 additions.

11Static wallpapers

Choose an image, preview it, confirm the target and handle cancellation.

12Persistent notifications

Channels, actions, expanded cards, progress and the in-device Previewer drawer. New in 1.7.0.

13NFC tags

Read text and links, write a spare tag, handle failures and simulate tags inside the Previewer. New in 1.9.0.

14Contacts

Choose one detail, search with permission and use native editors. Complete People Desk app and fictional desktop data. New in 1.9.0.

15Your own Java

Declare 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 phone

Haptics, speech, a web page, files, downloads, the calendar, the dialler, recording, printing, links and shares. New in 1.13.0.

17Outside the app

A home-screen widget, a quick settings tile, AdMob, updates through Play and Health Connect. New in 1.13.0.

18Timers

A function run later, or again and again, while its screen is on show. New in 1.13.0.

19The connection

Online or not, over what, and being told when it changes. New in 1.13.0.

20The display

Keep the screen on, set its brightness, hide the bars and choose which way up. New in 1.13.0.

21The app lock

Lock 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

  1. Copy the smallest example into writehere.py.
  2. Confirm callbacks and layout in the Hot Previewer.
  3. Run apkpy build.
  4. Open the generated project in Android Studio.
  5. 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.