{"id":45157471,"url":"https://github.com/couchbase-examples/android-kotlin-cbl-learning-path","last_synced_at":"2026-02-20T05:03:00.336Z","repository":{"id":38198634,"uuid":"482044580","full_name":"couchbase-examples/android-kotlin-cbl-learning-path","owner":"couchbase-examples","description":"Learn Couchbase Lite SDK with Kotlin and JetPack Compose for Android Developers","archived":false,"fork":false,"pushed_at":"2024-09-17T05:39:41.000Z","size":13751,"stargazers_count":3,"open_issues_count":7,"forks_count":3,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-09-17T08:22:42.162Z","etag":null,"topics":["android","android-application","couchbase-lite","couchbase-mobile","couchbase-sync-gateway","kotlin","kotlin-android"],"latest_commit_sha":null,"homepage":"https://developer.couchbase.com/learn/android-kotlin","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/couchbase-examples.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-15T18:07:35.000Z","updated_at":"2024-09-17T05:39:39.000Z","dependencies_parsed_at":"2024-05-01T11:51:14.567Z","dependency_job_id":"c42eee4f-214e-42a8-b9c8-f42247cb0945","html_url":"https://github.com/couchbase-examples/android-kotlin-cbl-learning-path","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/couchbase-examples/android-kotlin-cbl-learning-path","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fandroid-kotlin-cbl-learning-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fandroid-kotlin-cbl-learning-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fandroid-kotlin-cbl-learning-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fandroid-kotlin-cbl-learning-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/couchbase-examples","download_url":"https://codeload.github.com/couchbase-examples/android-kotlin-cbl-learning-path/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fandroid-kotlin-cbl-learning-path/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29641929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T03:21:14.183Z","status":"ssl_error","status_checked_at":"2026-02-20T03:18:24.455Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-application","couchbase-lite","couchbase-mobile","couchbase-sync-gateway","kotlin","kotlin-android"],"created_at":"2026-02-20T05:02:45.415Z","updated_at":"2026-02-20T05:03:00.331Z","avatar_url":"https://github.com/couchbase-examples.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learn Couchbase Lite with Kotlin and Jetpack Compose\n\nIn this learning path you will be reviewing an Android Application written in Kotlin and JetPack Compose that uses the Couchbase Lite Android SDK for Kotlin. You will learn how to get and insert documents using the key-value engine, query the database using the QueryBuilder engine or SQL++, and learn how to sync information between your mobile app and either a Couchbase Server using Sync Gateway or using peer-to-peer technology.\n\nFull documentation can be found on the [Couchbase Developer Portal](https://developer.couchbase.com/learn/android-kotlin).\n\n## Prerequisites\nTo run this prebuilt project, you will need:\n- Familiarity with building Android Apps with \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developer.android.com/kotlin\"\u003eKotlin\u003c/a\u003e, \u003ca target=\"_blank\" rel=\"noopener noreferrer\"  href=\"https://developer.android.com/jetpack/compose/mental-model\"\u003eJetPack Compose\u003c/a\u003e, and Android Studio \n- [Android Studio Chipmuck or above](https://developer.android.com/studio)\n- Android SDK installed and setup (\u003e v.34.0.0)\n- Android Build Tools (\u003e v.34.0.0)\n- Android device or emulator running API level 26 or above\n- JDK 11 (now embedded into Android Studio 4+)\n\n### Installing Couchbase Lite Framework\n\n- src/build.gradle already contains the appropriate additions for downloading and utilizing the Android Couchbase Lite dependency module. However, in the future, to include Couchbase Lite support within an Android app add the following within the Module gradle file (src/app/build.gradle)\n\n```bash\nallprojects {\n    repositories {\n        ...\n\n        maven {\n            url \"https://mobile.maven.couchbase.com/maven2/dev/\"\n        }\n    }\n}\n``` \n \nThen add the following to the \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/couchbase-examples/android-kotlin-cblite-inventory-standalone/blob/main/src/app/build.gradle\"\u003eapp/build.gradle\u003c/a\u003e file.\n\n```bash\ndependencies {\n    ...\n\n    implementation \"com.couchbase.lite:couchbase-lite-android-ktx:3.1.8\"\n}\n```\n\nFor more information on installation, please see the [Couchbase Lite Documentation](https://docs.couchbase.com/couchbase-lite/current/android/gs-install.html).\n\n## Demo Application \n\n### Overview\n\nThe demo application used in this learning path is based on auditing \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Inventory\"\u003einventory\u003c/a\u003e  for a fictitious company.  Most companies have some inventory - from laptops to office supplies and from time to time must audit their stock.  For example, when a user's laptop breaks, they can send out a replacement from the inventory of spare laptops they have on hand. \n\nUsers running the mobile app would log into the application to see the projects they are assigned to work on. Then, the user would look at the project to see which office location they need to travel to. Once at the site, they would inspect the number of items, tracking them in the mobile application.\n\n### Architecture\n\nThe demo application uses \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developer.android.com/jetpack/guide\"\u003eapplication architecture\u003c/a\u003e concepts in developing modern Android applications recommended by the Android development team.  \n\n\u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://insert-koin.io/\"\u003eKoin\u003c/a\u003e, the popular open-source Kotlin based injection library, is used to manage dependency inversion and injection.  Using Koin we can use JDK 11 versus Hilt or Dagger, which requires JDK 8.  \n\nThe application structure is a single Activity that uses \u003ca target=\"_blank\" rel=\"noopener noreferrer\"  href=\"https://developer.android.com/jetpack/compose/mental-model\"\u003eJetPack Compose\u003c/a\u003e to render the multiple compose-based views.  In addition, the \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developer.android.com/jetpack/compose/navigation\"\u003eNavigation Graph\u003c/a\u003e is used to handle routing and navigation between various views.  \n\nThe Inventory Database is a custom class that manages the database state and lifecycle.  Querying and updating documents in the database is handled using the \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developer.android.com/jetpack/guide#data-layer\"\u003erepository pattern\u003c/a\u003e.  \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developer.android.com/jetpack/guide#domain-layer\"\u003eViewModels\u003c/a\u003e will query or post updates to the repository and control the state of objects that the compose-based Views can use to display information. \n\n### Flow\n\nThe demo application starts with the InventoryApplication class, which inherits from the default Application class provided by Android.  \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://insert-koin.io/docs/reference/koin-android/start\"\u003eKoin\u003c/a\u003e recommends this structure and is used to set up all the dependencies, including services, repositories, and ViewModels.  \n\nMainActivity then runs the setContent method which set up lifecycle management and creates the navigation controller used to handle navigation in the application.  The InventoryNavGraph function handles routing between views and sets the start destination to the LoginView function.  The InventoryNavGraph passes which view the LoginView should route to if the user logs in successfully.\n\n## Try it out\n\n* Open src/build.gradle using Android Studio.\n* Build and run the project.\n* Verify that you see the login screen.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbase-examples%2Fandroid-kotlin-cbl-learning-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcouchbase-examples%2Fandroid-kotlin-cbl-learning-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbase-examples%2Fandroid-kotlin-cbl-learning-path/lists"}