- Do not add bussiness rules in the
View
. It should only call the Android API to perform UI actions. - Do not save state in the
View
. - Every click/tab/animation listener should call the
Presenter
to decide the next action. - Write unit tests for the
Presenter
usingMockito
andRoboletric
. We are not writing unit tests for theView
. - Use
RxJava
for asynchronous calls. - Use
Dagger
for dependency injection. - Try to use
ConstraintLayout
as your root view. - Use
ThreeThen
API to handle dates.
- Dev: Does not send crashes or logs to
Firebase
. - Staging: Does send crashes and logs to
Firebase staging
. - Prod: Does send crashes and logs to
Firebase prod
. Does not show logs in logcat.
Notes:
- Configuration paramaters for each build variant are defined in
build.gradle
file. Dev
andStaging
share the samegoogle_maps_api.xml
andgoogle-services.json
files.Prod
should have a differentFirebase
project.Staging
andProd
allow you to send logs toFirebase Crashlytics
when usingTimber.e(e: Exception)
.
We are using ktlint as our lint tool.
Code style configuration file is stored in codeStyle/kotlinCodeStyle.xml
, you can import it in your IDE.
- It runs before each build (local builds included).
- If it fails, reports are stored in
app/build/ktlint.xml
. You can fix the errors manually or by running./gradlew ktlintFormat
.
We are using Bitrise as our Continuos Integration tool. Signing credentials to upload the app to the Play Store are stored there (Worflows / Code Signing)
Workflows:
- Primary: It runs for each push and ensures that
./gradlew testDevDebugUnitTest
does not fail. - Deploy: It runs for each merge to master and updates version code, version name and outputs a release APK file. To download the signed APK and mappings file tap on the corresponding build and go to
Apps & Artifacts
.
TODO: We could automatically upload the APK to Play Store (currently we are doing it manually).
We added a template to make easier the creation of new MVP Activities, follow these steps to add it to your Android Studio installation:
- Copy the folder
MVPTemplate
included in this project to your Android Studio templates folder (/Applications/Android Studio/Contents/plugins/android/lib/templates/other
) - Restart Android Studio
- From Android Studio right click on the folder where you want to add a new
MVP Activity
- Go to
New/Other/MVP Template
and fill the fields
https://github.com/LateralView/android-base-project
Here you will find useful links and documentation about Android Development and our coding standars at Lateral View.
For any suggestions or if you want to join our team please contact us via [email protected]
Happy codding!
Developed by the Lateral View team.