This repository holds the source code of the Bragi Application, a simple Android application which can read numbers and present them. This application was created by Mohsen Mirhoseini Argi, as part of the technical assessment by the Bragi team.
- Bragi Application
-
Version: 1.0
- Last Update: Sun Nov 20, 2016
- Android Studio v2.2.2
- gradle-plugin v2.2.2
- Android SDK Build Tools v25.0.1
- MinSdkVersion 9
- CompileSDKVersion 25
- Retrolambda v3.3.1
- Android Support Tools (support, appcompat, recyclerView, vector) v25.0.1
- Retrofit v2.1.0
- Okhttp v3.4.1
- Dagger v2.4
- RxJava v1.1.9
- RxAndroid v1.2.1
- Butterknife v8.0.1
- AndroidUtils v1.0.7
- jUnit v4.12
- Android Support Test v0.5
- Mockito v1.10.19
- Robolectric v3.1.1
- Espresso v2.2.2
The application has one Activity, MainActivity. The MainActivity is consist of one Fragment, NumbersFragment, which is responsible for presenting numbers records.
All activity lifecycle and network behaviours are implemented, and according to device size and network situation user get a good UI and UX. If no internet connection or network error, a Snackbar pops up and ask user to turn on network connection or retry.
Some Test Cases was designed to test application UI functionality and core java classes using jUnit and AndroidUnitTest.
The Application implemented and structured bases on the MVP pattern best practice, contributed by Antonio Leiva.
Whole application functionality is implemented in "core-lib" module using pure Java, and the "app" module contain all codes required for Android Application to load on Android OS, which can be replace by any other interface (e.g. a console app or a web app)
The view (MainActivity), contain one fragment. NumbersFragment contain it's own presenter and implement View interface and the only thing that the view will do is calling a method from the presenter every time there is an UI action.
The presenter (NumbersPresenter), is responsible to act as the middle man between view and model. It retrieve data (Numbers) from the Model and return it formatted (DataModel) to the view. It also decides what happens when user interact with the view.
The models (NumbersInteractor), would only be the gateway to the service domain layer (or business logic). In this case it provide the data needed to be displayed in the view from Network.
The networking and API call are managed by Retrofit and OkHttp as its httpclient, contributed by Square. It also shows decent logs when application is running in Debug mode.
Layers communications are managed by RxJava & RxAndroid contributed by ReactiveX.
Dependency Injections (DI) are being managed by Dagger created by Square and now maintained by Google.
Some minor Android common functions are managed using AndroidUtils library, developed and published on jCenter by myself.
Whole projects Dependencies are placed in "libraries.gradle" to avoid version conflicts and redundant between "app" and "core-lib" modules.
Used new DataBinding library contributed by Google in Adapters for faster development.
Used new SupportVector library in some icons cases for a better UI.
Sample test cases are implemented by a mixture of Mockito, Espresso, Robolectric and mocking Dagger.
Finally, used circleci and travis ci as Continues Integration (CI) services which are bind with project Github repo.