Android Barebone Project
A barebone MVVM architecture based Android project with some essential tools configured the right* way. See Android Architecture Blueprints v2 for more comprehensive app architecture example.
Inspiration: The architecture is inspired by combination of different project by Google and Android Community, such as:
There are few essentials that are added to the project. Best way to see what is included is to check the latest dependecies from app/build.gradle
Here are list of dependencies included:
- Material Theme
- ViewPager 2
- Kotlin Extensions (KTX)
- Firebase Crashlytics
- Firebase Analytics
- Timber - android logging
- Dagger 2 - dependency injection for Activity and Fragment
- RxJava 2 - ReactiveX Java
- Retrofit 2 - REST API
- OkHttp - with logging interceptor
- Gson - JSON response parsing
- Mockito - unit test mocking
- Leak Canary 2 (alpha) - automatic memory leak detection
- Kt Lint Format - An anti-bikeshedding Kotlin linter with built-in formatter
Optional Library and Integrations
You may need to delete optional features based on your need.
- CircleCI integration for CI/CD.
💻 TODO After cloning repo)
- You must create a Firebase project and use the
google-services.jsonfrom your project. A placeholder google-services.json is provided so that app compiles.
- You must update package name and application ID where applicable.
- Remove feature
Yactivities and related resources. However, it may be beneficial to keep them as reference point at initial phase of the project.
- Remove fragment
Cand related files like ViewModel and Layout files. Make sure you study how each activity that hosts Fragment requires a separate
- Remove unused libraries that are added in app/build.gradle
- Also update your application's theme color. See styles.xml
Currently the barebone app has following sample activities:
MainActivity- Hosts fragments using
ViewPagerand navigates using
Feature X- showcases how REST call is made using injected service in ViewModel.
Feature Y- showcases how RecyclerView can be used in conjunction with DiffUtils.
Feature Z- showcases how Fragment can also have injection and use service in ViewModel.