{"id":24714441,"url":"https://github.com/ml-opensource/android-template","last_synced_at":"2025-10-09T12:31:36.925Z","repository":{"id":38452895,"uuid":"312517009","full_name":"ml-opensource/android-template","owner":"ml-opensource","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-29T16:31:46.000Z","size":679,"stargazers_count":19,"open_issues_count":8,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-03T19:52:05.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ml-opensource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-11-13T08:29:57.000Z","updated_at":"2025-06-05T08:40:47.000Z","dependencies_parsed_at":"2023-12-12T09:40:24.627Z","dependency_job_id":"daee070f-32c7-4de0-abb9-f3824ce76e8c","html_url":"https://github.com/ml-opensource/android-template","commit_stats":null,"previous_names":["ml-opensource/android-template","monstar-lab-oss/android-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/ml-opensource/android-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2Fandroid-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2Fandroid-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2Fandroid-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2Fandroid-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ml-opensource","download_url":"https://codeload.github.com/ml-opensource/android-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2Fandroid-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001443,"owners_count":26083078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-01-27T08:16:36.882Z","updated_at":"2025-10-09T12:31:36.463Z","avatar_url":"https://github.com/ml-opensource.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://engineering.monstar-lab.com/assets/img/logo/ml-logo-grey.png\"  height=\"23\"\u003e \u0026nbsp;     Android Template \u003cimg src=\"https://android-developers.googleblog.com/favicon.ico\" height=23/\u003e\n\nThis is a opinionated template for new Android projects used and open sourced by Monstarlab.\n\n\n💻 **Techstack** \n-   \u003cimg src=\"https://kotlinlang.org/assets/images/favicon.svg?\u0026v=8607ff59d5296c7642ecd72bd3daa79b\" height=12 /\u003e 100% Kotlin\n- 🔄 Kotlin Coroutines for async operations \n- 🚀 Jetpack Architecture Components\n- \u003cimg src=\"https://developer.android.com/static/images/spot-icons/jetpack-compose.svg\" height = 16\u003e  Jetpack Compose ❤️\n- ☁️ [OkHttp](https://github.com/square/okhttp) and [Retrofit](https://github.com/square/retrofit) for networking\n- 🔗 [Kotlin Serialization](https://kotlinlang.org/docs/serialization.html) as primary JSON (de)serialization tool\n- 🗡️ [Dagger / Hilt](https://dagger.dev/hilt/) for Dependency Injection\n- ✨ [Spotless](https://github.com/diffplug/spotless) for code-format control\n- 🔍 [Detekt](https://github.com/detekt/detekt) for static code analysis\n- 🌐 [Chucker](https://github.com/ChuckerTeam/chucker) - network traffic logger\n- 🐤 [LeakCanary](https://square.github.io/leakcanary/) -  memory leak detection \n\n\n# Table of contents\n1. [Before you start](#⚠️-before-you-start)\n2. [Template Structure](#project-structure)\n3. [Architecture](#architecture)\n4. [Flavours](#flavors)\n5. [Tools](#tools)\n\n\n## ⚠️ Before you start \n\nBefore you start using the template, you probably want to install the [Jetpack Compose UI Architecture Plugin](https://plugins.jetbrains.com/plugin/19034-jetpack-compose-ui-architecture-templates) on Android Studio.\n\nThis plugins facilitates the work when creating new Compose screens.\n\nAfter installing, creating new features in the correct template structure should be as easy as doing the following:\n\n**1 - Select the \"New feature\" option**\n\n![](https://user-images.githubusercontent.com/8679058/223730854-7e199e33-1b99-49a3-ae1b-30a6ea725681.png)\n\n\n**2 - Name your new feature**\n\n![](https://user-images.githubusercontent.com/8679058/223731483-d0fce3f9-dba4-459d-9bb5-65e76abe2ee6.png)\n\n\n**3 - The correct folder structure should be created for you**\n\n![](https://user-images.githubusercontent.com/8679058/223731540-1604198c-78ac-4b3b-ad84-b3fc290746af.png)\n\n\n\n## Project Structure \u0026 Modules\nAndroid template project has a modular structure and has following modules: `:core`, `:designsystem`, `localization` and `:app`. The intention is to make this template as flexible as possible by introducing shared modules while having the all the features reside in `:app` module. In case project grows, this allows to easily decouple features from `:app` module and/or introduce new features as part of separate module.\n\n![](./resources/modules.svg)\n\n### `build-logics` module\nBuild logics module contains all the build logic that is shared across the project. That includes min sdk, target sdk, compose setup, and so on. This module provides convention plugins that are used in other modules to apply these common settings.\n\n### `core` module\nCore module is meant to be Domain-agnostic. It means that it should never reference anything project specific. Instead, it serves as a home for components that can be part of any project. This includes extensions on Kotlin Classes, Utility classes, Base classes, Compose layouts and Compose Effects and Modifiers that are behavioural rather then UI emitting\n\n\n### `designsystem` module\nThe design system module contains the building blocks for your application's UI. The main thing you will find here is `Theme`. This template is using custom `Theme` provider for Jetpack Compose while having `Material Theme` as its foundation. This allows to tweak `Colors` and `Typography` so it reflects actual Design System that is used on the project and supply custom properties like `Dimensions`\n\nAnother part of the design system are components. Examples of `designsystem` components are Buttons, TopBars, TextFields and so on. The template provides `AppButton` `AppTextField` and `AppTopBar` that you can modify and tweak and use throughout the project.\n\n### `localization` module\nLocalization module contains NStack configuration and Translations.java file so that all localization is in one place. This module is meant to be used in the `app` module to prvoide translations for the `app` and `designsystem` module to provide translations for the design system components (such as accesaibility labels)\nThe NStack is configured in its `build.gradle.kts` and initilized using androidx Startup library. \n\n### `app` module\nThis is a main modules that contains feature packages - the meat of any project. A Feature typically contains all the necessary code, resources and assets required to implement a specific application functionality, such as a login screen, shopping cart, or authentication.  It may also have its own sets of dependencies, like third-party libraries or other features.\n\n#### Feature modules\nWhile the template doesn't really have feature modules and every feature is part of the `:app` module, it is adviced to make use of feature modules in case the you see there is good candidate for it. It will especially benefit mid to large sized projects under active development\n\n Each feature (module or not) is following [Clean Architecture Principles and has a three-layer split](#architecture)\n\n## Architecture\nTemplate implements [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) and follows [best practices](https://developer.android.com/topic/architecture) provided by Google with some tweaks here and there\n\n### Presentation layer\nIn our Android world, the Presentation layer or UI Layer is our Activities, Fragments, Jetpack Compose UI screens and components and ViewModels. The Presentation layer interacts with Domain Layer where our business logic happens.\n\n### Domain layer\nThe domain layer contains the application's business logic. This layer should only work with abstractions and as such it would never know about how different layers look like. It shouldn’t know about any Databases, APIs, or even Android Framework.\n\n### Data layer\nThe data layer is where the actual interactions happen between different data sources. This layer “implements” parts of the Domain layer and communicates with the APIs, Databases, and other services and SDKs.\n\n\n![](/resources/arch.svg)\n\n\n## Flavors\n\n- **Dev**: Intende for developers use only. Usually will have the same endpoints as staging. This have LeakCanary to help detect leaks.\n- **Staging**: Intended for QA and internal testing. This usually have api endpoint for a testing server.\n- **Release**: Intended for release. This version usually have live endpoint and signed builds.\n\n## Tools\nThese are the tools used in the template, to improve the development, that you should be aware of:\n\n### [Spotless](https://github.com/diffplug/spotless)\nSpotless is a Gradle plugin used to format source files. You can use it running the following Gradle commands:\n\n`./gradlew spotlessCheck` - Checks the style formatting and displays any issues\n\n`./gradlew spotlessApply` - Same as above but automatically try to fix most of the issues. If for any reason it can't, then a list of problems is displayed.\n\n\n### [Chucker](https://github.com/ChuckerTeam/chucker)\nChucker is a HTTP inspector to help check the api calls when the app is being executed, this is helpful for both devs and QAs to analyse the trafic data. It should show as a notification when the app is ran. Note that is uses an `Interceptor` in the `OkHttpClient` to get the data, so if you need to create a new `OkHttpClient` for any reason, remember to also add the Chucker's `Interceptor`.\n\n### [LeakCanary](https://square.github.io/leakcanary/)\nLeakCanary is a memory detectiong library that will automatically run in `devDebug` builds. It will automatically detect memory leaks and in case anything is found a notification will be shown. After that the details of the leak can be viweed both by clicking the notification on in the Logcat. This is intended for devs to spot and fix any leaks as early as possible. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-opensource%2Fandroid-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fml-opensource%2Fandroid-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-opensource%2Fandroid-template/lists"}