This is a simple template for Android apps that follows best practices.
- UI with Android Compose
- Library management with Kotlin DSL
- Modularization
- Dependency injection with Dagger-Hilt
- Network calls with OkHttp and Retrofit
- Local storage with Room
- Navigation with Navigation Compose
- Create a repository that uses this repository as a template
- Open the project in Android Studio
- In
app/res/values/string.xml, changeapp_nameto your desired application name - In
settings.gradle.kts, changerootProject.nameto your desired application name - In every app module
build.gradle.kts, changenamespaceandapplicationIdto your desired package name - In all the other module level
build.gradle.kts, changenamespaceto the corresponsing package name. For example, if your package iscom.alexru.myapp, change thenamespacefor the data-local module tocom.alexru.data_local - Refactor and rename the project folders.
Select All Directoriesin the popup menu and rename the package to your desired package name. Make sure the scope isProject Files. Do this for every module. - Sync Gradle scripts in the File menu. You can also press
Ctrl+Shift+O. - Clean and rebuild the project in the Build menu.
If you're unsure what to do, I highly recommend Clean Android Architecture by Alexandru Dumbravan. The book is somewhat outdated, but it still has a lot of good information about clean architecture. I also recommend videos by Philipp Lackner. He has some good videos about multi-moduled projects and clean architecture. There is a decent amount of flexibility with this template, so you can do whatever you want!