Knowledge Hub is an Android study app for structured technical learning. It organizes content as domains, sections, and concepts, then lets the user browse, search, bookmark, and review material with quick definitions, optional code examples, richer detail content, structured references, and guided challenges.
The app is built entirely in Kotlin with Jetpack Compose, uses Room as the local data layer, Hilt for dependency injection, DataStore for UI preferences, and ships with a built-in catalog that can seed fresh installs and sync richer content into existing installs.
- Domain -> section -> concept learning model for structured study paths.
- Fast local search backed by Room FTS4.
- Bookmarking and progress tracking for saved review flows.
- Concept detail pages with markdown-style long-form content, clickable links, and structured references.
- Optional code examples and coding challenges per concept.
- Import guide for custom JSON content, including deep detail pages and references.
- JSON import on Home plus backup export/restore from Settings.
- User preferences for theme and text size.
- Offline-first data storage with Room migrations and built-in catalog sync.
- Kotlin 2.2.10
- Android Gradle Plugin 9.1.0
- Jetpack Compose Material 3
- Hilt 2.57.1
- Room 2.8.4
- Navigation Compose 2.8.3
- DataStore Preferences 1.1.1
- Coroutines 1.9.0
- Markwon 4.6.2
- Gson 2.10.1
- Paging 3.3.2
app/src/main/java/com/mlhub/knowledgehub/
├── data/
│ ├── database/ # Room entities, DAOs, migrations, FTS table
│ ├── repository/ # App data access, built-in catalog sync, preference persistence
│ └── seed/ # Built-in catalog and detail-page enrichment
├── di/ # Hilt modules
├── domain/model/ # UI and import models
└── presentation/
├── components/ # Reusable Compose UI
├── navigation/ # NavHost and routes
├── screens/ # Home, domain, detail, search, bookmarks, options, import guide
├── theme/ # Theme system and typography
└── viewmodel/ # Screen state management
- Home
- Domain detail
- Concept detail
- Search
- Bookmarks
- Import guide
- Options
- Android Studio with a recent SDK setup
- JDK 17
- Android SDK 26+
./gradlew assembleDebug./gradlew testDebugUnitTest./gradlew assembleDebugAndroidTest./gradlew lintDebugRelease signing reads passwords from environment variables:
- KEYSTORE_PASS
- KEY_PASS
Then build with:
./gradlew assembleReleaseThe app stores content in three layers:
- Domain: top-level topic group
- Section: subsection inside a domain
- Concept: individual study card with definition, tags, difficulty, and optional extras
Concepts can include:
definitioncodeExampledetailedContentchallengechallengeSolutionimageUrireferencesJsonfor structured source links rendered on the detail page
The Room database is currently at version 4 and includes an FTS4 virtual table for search. Search indexes term, definition, tags, and detailedContent. Structured references are stored separately and are not part of search.
Custom imports use snake_case JSON keys. Example:
[
{
"domain_name": "Backend Engineering",
"icon": "🧩",
"color_hex": "#2563EB",
"accent_hex": "#60A5FA",
"description": "API and infrastructure fundamentals",
"sections": [
{
"title": "HTTP",
"concepts": [
{
"term": "Idempotency",
"definition": "Repeating the same request yields the same effect.",
"code_example": "PUT /users/42",
"tags": "http,api",
"difficulty": 2,
"detailed_content": "## Overview\nIdempotency matters for retries, distributed workflows, and safe client behavior.",
"challenge": "Explain why retries are safer for idempotent endpoints.",
"challenge_solution": "The server can apply the same request multiple times without changing the final state.",
"image_uri": null,
"references": [
{
"title": "HTTP Semantics",
"url": "https://www.rfc-editor.org/rfc/rfc9110",
"source": "IETF",
"kind": "specification"
}
]
}
]
}
]
}
]Supported concept keys:
termdefinitioncode_exampletagsdifficultydetailed_contentchallengechallenge_solutionimage_urireferenceswith objects shaped as{ "title", "url", "source", "kind" }
Duplicate concepts are still skipped during import rather than overwritten.
See the in-app Import Guide screen for the supported structure and import workflow.
- Search uses Room FTS4 for fast local lookups.
- Paging dependencies are included for scalable list loading.
- The built-in catalog seeds fresh installs and also runs a versioned content sync so existing users receive newer detail pages and references.
User preferences are stored with DataStore and currently support:
- Theme: system default, light, dark, sepia, high contrast
- Text size: small, medium, large, extra large
The test suite covers repositories, view models, import behavior, migrations, and search logic.
Run unit tests (no device needed):
./gradlew testDebugUnitTestAssemble instrumented test APK (device/emulator only needed when running tests):
./gradlew assembleDebugAndroidTest- The app uses local storage only; there is no remote backend.
- Built-in content is available on fresh install and can be refreshed into older installs through the app's catalog sync path.
- Detail pages can include both inline markdown links and structured references rendered as dedicated source buttons.
- Launcher icon resources are defined in XML so they remain editable in source control.