- Kotlin 63.3%
- JavaScript 20.2%
- Shell 9.2%
- HTML 4.5%
- TypeScript 2.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .agents/skills | ||
| app | ||
| gradle | ||
| .gitignore | ||
| AGENTS.md | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
| skills-lock.json | ||
Doc Pocket
An offline documentation reader for Android. Browse and install docs from devdocs.io, then read them anywhere — no connection required. Pages are cached locally in a Room database and rendered in an in-app WebView.
Built with Kotlin + Jetpack Compose, Hilt, Room, Retrofit, and WorkManager.
Features
- Library of installed docs, each downloadable on demand.
- Catalog of available docs pulled live from devdocs.io.
- Reader with a collapsible topic sidebar, in-page find, section (
#anchor) navigation, and bookmarks. - Search across a single doc or all installed docs.
- Background downloads with a foreground-service progress notification.
Requirements
- Android Studio (or just the command line)
- JDK 21 to run Gradle (the project's bundled Kotlin cannot parse newer JDKs)
- Android SDK (compile/target API 36; minimum supported device API 26)
Building the APK
From the repo root, first point Gradle at JDK 21, then build the debug APK:
export JAVA_HOME=$HOME/.local/lib/jdk21
export PATH=$JAVA_HOME/bin:$PATH
./gradlew assembleDebug
The APK is written to:
app/build/outputs/apk/debug/app-debug.apk
Install it onto a connected device/emulator with:
adb install app/build/outputs/apk/debug/app-debug.apk
If
./gradlewfails withIllegalArgumentException: 25.0.4, you forgot theJAVA_HOMEexport above — Gradle is picking up a newer system JDK.
Other useful tasks
| Task | Purpose |
|---|---|
./gradlew compileDebugKotlin |
Fast compile-only check after editing code |
./gradlew assembleDebug |
Build the debug APK |
./gradlew clean |
Clear stale generated sources (KSP/Room/Hilt) if builds act up |
There is no test suite and no CI configured.
Project layout
app/
└── src/main/java/com/docpocket/
├── MainActivity.kt # Single-activity entry point
├── DocPocketApplication.kt # @HiltAndroidApp + WorkManager setup
├── di/ # Hilt modules (Room, DAOs)
├── data/
│ ├── local/ # Room DB, entities, DAOs
│ ├── remote/ # Retrofit APIs, OkHttp, two base URLs
│ ├── model/ # DTOs (devdocs index/catalog)
│ └── repository/ # DocsRepository (catalog/index/db pipeline)
├── download/ # @HiltWorker download + streaming parse
├── ui/
│ ├── library/ # Installed docs (home)
│ ├── catalog/ # Downloadable docs
│ ├── reader/ # Reader: sidebar + themed WebView
│ ├── search/ # Global search
│ ├── components/ # Reusable composables (WebView, etc.)
│ ├── navigation/ # NavHost + routes
│ └── theme/ # Material3 theming
└── util/ # HTML theming/injection, constants
Single Gradle module :app, package com.docpocket.
How it works
Doc content comes from devdocs.io in three stages:
- Catalog —
https://devdocs.io/docs.jsonlists everything installable. - Index — per doc,
index.jsondefines the entry tree (names, types, paths). - Pages —
db.jsonis a large{ "path": "html" }map, streamed and inserted into Room in batches.
At read time, page HTML links are rewritten to a custom devdocs://{slug}/{path} scheme and intercepted in-app, so navigation stays fully offline. Selected entries with a #anchor scroll to the matching section in the WebView.