This repository contains a detailed sample app that implements MVP architecture in Kotlin using Dagger2, Retrofit, RxJava, Constraint-Layout, Leak Canary, Firebase, Fastlane and CircleCI
- data: It contains all the data accessing and manipulating components such as database, netorkw APIs, prefernces,... etc.
- di: Dependency providing classes using Dagger2.
- ui: View classes along with their corresponding Presenters.
- utils: Utility classes.
- RxJava2: https://github.com/amitshekhariitbhu/RxJava2-Android-Samples
- Dagger2: https://github.com/MindorksOpenSource/android-dagger2-example
- Retrofit: https://github.com/square/retrofit
- LeakCanary: https://github.com/square/leakcanary
- Fabric Crashlytics: https://github.com/plastiv/CrashlyticsDemo
- RxFirebase: https://github.com/kunny/RxFirebase
- GSON: https://github.com/google/gson
- Kotlin Linter: https://github.com/pinterest/ktlint
- AutoFitTextView: https://github.com/grantland/android-autofittextview
- Alerter: https://github.com/Tapadoo/Alerter
- Espresso UI Testing: https://developer.android.com/training/testing/espresso
- Mockito Testing: https://github.com/mockito/mockito
- Introduction to Dagger 2: Part 1
- Introduction to Dagger 2: Part 2
- Android Dagger2: Critical things to know before you implement
- Android Continuous Integration using Fastlane and CircleCI 2.0 — Part I
- Android Continuous Integration using Fastlane and CircleCI 2.0 — Part II
- Android Continuous Integration using Fastlane and CircleCI 2.0 — Part III
Add your Fabric ApiKey in AndroidManifest.xml
<meta-data
android:name="io.fabric.ApiKey"
android:value="<YOUR_API_KEY_GOES_HERE>"/>
To avoid having private data info hardcoded in the code, we modify lane file to use environment variables. You need to set the following variables in the CircleCI environment variables:
- STORE_PASSWORD: Your keystore password.
- KEY_ALIAS: Key alias of your generated keystore.
- KEY_PASSWORD: Key password of your generated keystore.
- RELEASE_KEY_STORE: Your keystore. You firstly need to convert your
keystore.jks
to base64. To do that, simply runbase64 keystore.jks
. - GOOGLE_SERVICES: Firebase configurations. You firstly need to convert your
google-services.json
to base64. To do that, simply runbase64 keystore.jks
. - CRASHLYTICS_API_TOKEN: Fabric ApiKey.
- CRASHLYTICS_BUILD_SECRET: Fabric Build Secret.
Add the Firebase Android configuration file to the project:
- download google-services.json to obtain your Firebase Android config file (
google-services.json
) - Move your config file into the module (app-level) directory of the project.
If you don't need firebase services, you have to do the following:
- remove
apply plugin: 'com.google.gms.google-services'
fromapp/build.gradle
- remove
decode_google_services
from.circleci/config.yml
Copyright (C) 2019 Blink22