Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Marvel Characters Android Application Assigned by smava GmbH

License

NotificationsYou must be signed in to change notification settings

mohsenoid/marvel

Repository files navigation

This repository holds the source code of the Marvel Application, a simple Android client for theMarvel.com.This application was created byMohsen Mirhoseini, as part of the technical assessment by thesmava GmbH team. It also has been used as a sample project for a series of technical articles and tutorials.


What is this repository for?

  • Marvel Application
  • Version: 1.0.1
  • Last Update: Wed June 27, 2018

ScreenshotScreenshot


Development Tools

  • Android Studio v3.1.3
  • gradle-plugin v4.4
  • Android SDK Build Tools v27.1.1
  • MinSdkVersion 14
  • CompileSDKVersion 27

Dependencies

  • Android Support Tools (recyclerView, cardView, vector, palette,... ) v27.1.1
  • Retrofit v2.1.0
  • OkHttp v3.4.1
  • Dagger v2.8
  • RxJava2 v2.1.13
  • RxAndroid v2.0.2
  • RxBinding v2.1.1
  • ButterKnife v8.8.1
  • Timber v4.7.0
  • Picasso v2.5.2
  • OrmLite v5.0
  • Firebase v16.0.1
  • AndroidUtils v1.0.11
  • jUnit v4.12
  • Android Support Test v1.0.2
  • Mockito v1.10.19
  • Robolectric v3.8
  • Espresso v2.2.2

Important Notes

The application includes two Activities, Main and Character Activities. The Main Activity is consist of two Fragments, Search and Cache Fragments, which are responsible for searching new Marvel characters and presenting recently searched characters.

All activity lifecycle and network behaviors 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 the user to turn on the 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 based on the MVP pattern best practice, contributed byAntonio Leiva.

Whole application functionality is implemented in "Core-Lib" module using pure Java, and the "App" module contains all codes required for Android Application to load on Android OS, which can be replaced by any other interface (e.g. console app or web app)

Theview (MainActivity), contain two fragments. Search and Cache fragments both contain their 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.

Thepresenter (Search or Cache Presenters), are responsible to act as the middleman between views and models. They retrieve data from Backend or Database and returns it formatted to the view. It also decides what should happens when user interacts with the view.

Themodels (Search Interactor), would only be the gateway to the service domain layer or business logic. In this case, it provides the data needed to be displayed in the view from Network.

The networking and API calls are managed byRetrofit and OkHttp as its httpclient, contributed bySquare. It also shows decent logs while the application is running in Debug mode.

Caching characters data is done usingOrmLite, a Lightweight Object Relational Mapping (ORM) Java Package. Database layer can also be done using other ORM libraries likerealm orDBFlow.

Layers communications are managed byRxJava &RxAndroid contributed byReactiveX.

Dependency Injections are being managed byDagger created bySquare and now maintained byGoogle.

Diagram

Some minor Android common functions are managed usingAndroidUtils library, developed and published on jCenter bymyself.

Whole projects Dependencies are placed in "libraries.gradle" to avoid version conflicts and redundant in different modules.

Used new DataBinding library contributed by Google in Adapters for faster development, and added CustomBindingAdapter to handle downloading and caching images usingPicasso library, which also use GooglePalette support library as a helper class to extract prominent colors from image and making a related background for a better UI/UX.

The Android Log system is replaced withTimber contributed by Jake Wharton, which avoids logging in the release version.

A general HashGenerator class generates the hash key required for calling API using params.

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

Used newGoogle Firebase as application Analytics and CrashReport services.

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

Finally, usedcircleci andtravis ci as Continues Integration services which are bind withGithub repo.


Read more...

You can read more about this sample project in this 5-part article:

and to get the exact code at that point check out this tag:https://github.com/mohsenoid/marvel/releases/tag/Yet-another-MVP-article


[8]ページ先頭

©2009-2025 Movatter.jp