Android native app for Z
- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| app | ||
| .gitignore | ||
| build.gradle | ||
| gradle.properties | ||
| preview.png | ||
| README.md | ||
| settings.gradle | ||
ZChat
A minimal native Android chat client for Z.AI's GLM-5.3-Flash (streaming, vision-capable), styled after the flat monospace look of NomadWriter.
Features
- Streaming chat — SSE streaming; reasoning models show their thinking process live in italics above the answer
- Tabbed history — every chat is a tab (
+new, long-press to delete), persisted across restarts;Ztab is the home screen - Attachments — photos (auto-resized to max 1920px, sent as base64 vision content) and text files (inlined into the message)
- Code blocks —
```fenced sections render as code with a tap-to-copy link under each block - Themes — day / night / auto; auto follows the hardware brightness sensor with hysteresis (falls back to the system night mode)
- Token meter — per-response usage from the API: total spent (today / week / total, in SQLite) and next-request context size as % of the 1.31M-token window
- Resilience — automatic endpoint fallback (API-key vs Coding-Plan endpoints), one silent reconnect when a stream dies before any content arrives, partial answers are kept on mid-stream connection loss
- Background notifications — reply (or error) arrives while the app is not on screen → system notification
Setup
- Build and install (see below), launch the app.
- Tap
➤(or send anything) — paste your Z.AI API key when prompted. Long-press➤to change it later. - Talk.
Both normal API keys and GLM Coding Plan keys work — the app tries api/paas/v4 first, then the Coding-Plan-only api/coding/paas/v4, and remembers which one your key needs.
Build
Plain Java, no AndroidX, no external dependencies.
gradle assembleRelease # unsigned release APK
- AGP 8.13.2, compileSdk 34, minSdk 23
- every
assemble*bumps the patch version inapp/version.properties
Data & privacy
- chats live in
files/chats.json, token stats infiles/stats.db(both local only) - the API key lives in a private SharedPreferences file
- the only network traffic is HTTPS to
api.z.ai
License
Do whatever.
