Name: LiipAndroidTemplate
Owner: Liip
Description: An Android template project with best libs and best practices
Created: 2017-01-13 11:57:44.0
Updated: 2017-05-11 07:42:00.0
Pushed: 2017-02-15 08:47:14.0
Size: 116
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This project aims to group best practices and best libraries for Android development. The sample app is a shopping list creator.
It demonstrate how to instantiate fragments with parameters and automatically save their parameters as well as their DTO state using IcePick and FragmentArgs.
To make it savable/restorable, DTOs are made parcelable using ParcelablePlease library.
To associates UI components to field variable and listener methods, we use Butterknife.
In order to easily change logging system, we use Timber as a logging entry point, which is integrated with Android-Logger for pretty printing.
For API calls, we use Retrofit 2 integrated with RxJava.
Services are injected using Dagger. Dagger is configured to instanciate two different services configuration according the selection of one of the predefined flavours : mock and full. The mock configuration provide a mocked Retrofit mock proxy that simulate behaviour of the network (async delay, failures, etc) to test error handling.
A default implementation for error handling is implemented. One of the error handlers manage retrofit network errors and in case of API error, parse the error response. For that, we use a CallAdapterFactory proxying RxJavaCallAdapterFactory (RxJava - Retrofit bridge).
To be able to use Java8 lambdas and method references, the code is processed with the Retrolambda processor. We simulate Java8 streams using Annimon Stream library.