Skip to content

AllenCoder/Android-coding-challenge

 
 

Repository files navigation

Autolabs Application CircleCI Build Status

This repository holds the source code of the Weather Android Application, a simple Android client for the Open Weather Map. This application was created by Mohsen Mirhoseini Argi, as part of the technical assessment by the German Auto Labs GAL GmbH team.


What is this repository for?

  • Autolabs Application
  •   Version:  1.0
    
  • Last Update: Wed Jan 4, 2017

Screenshot


Development Tools

  • Android Studio v2.2.3
  • gradle-plugin v2.2.3
  • Android SDK Build Tools v25.0.0
  • MinSdkVersion 9
  • CompileSDKVersion 25
  • Retrolambda v3.3.1

Dependencies

  • Android Support Tools (recyclerView, cardView, vector,... ) v25.0.1
  • Retrofit v2.1.0
  • OkHttp v3.4.1
  • Dagger v2.8
  • RxJava v1.2.3
  • RxAndroid v1.2.1
  • ButterKnife v8.4.0
  • Timber v4.3.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

Important Notes

The application has one Activity, MainActivity. The MainActivity is consist of a search UI and a Fragment, WeatherFragment, which is responsible for presenting searched city current weather.

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 simple Test Cases was designed to test application UI functionality and core classes using jUnit and AndroidUnitTest.

Application Structure

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. 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. console app or web app). You can read more about my method in this article published by me on hackernoon.com

The view (MainActivity), contain one fragment. WeatherFragment contain its own presenter and implement View interfaces and the only thing that the view will do is calling a method from the presenter every time there is an interface action.

The presenter (WeatherPresenter), is responsible to act as the middle man between view and model. It retrieves data from the Model and returns it formatted to the view. It also decides what happens when user interact with the view.

The models (WeatherInteractor), 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 while application is running in Debug mode.

Layers communications are managed by RxJava & RxAndroid contributed by ReactiveX.

Dependency Injections are being managed by Dagger created by Square and now maintained by Google.

Diagram

It was my first experience with Speech Recognition Applications, so after a research I preferred to use Android SpeechRecognizer service, however, I know that this part is not so professional and require more changes.

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 in different modules.

Used new SupportVector library in some icons cases for a better UI.

Used new DataBinding library contributed by Google in Adapters for faster development, and added CustomBindingAdapter to replace API weather icons with in-app Vector assets for a better UI.

The Android Log system is replaced with Timber contributed by Jake Wharton, which avoid logging in release version.

Sample test cases are implemented by mockito, espresso, robolectric and mocking dagger.

Finally, used circleci and travis ci as Continues Integration services which are bind with Github repo.

About

Weather Android Application Assigned by German Auto Labs GAL GmbH

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%