• Stars
    star
    228
  • Rank 174,740 (Top 4 %)
  • Language
    Java
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Marvel Characters Android Application Assigned by smava GmbH

Marvel Application CircleCI Build Status codecov

This repository holds the source code of the Marvel Application, a simple Android client for the Marvel.com. This application was created by Mohsen Mirhoseini, as part of the technical assessment by the smava 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

Screenshot Screenshot


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 by Antonio 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)

The view (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.

The presenter (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.

The models (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 by Retrofit and OkHttp as its httpclient, contributed by Square. It also shows decent logs while the application is running in Debug mode.

Caching characters data is done using OrmLite, a Lightweight Object Relational Mapping (ORM) Java Package. Database layer can also be done using other ORM libraries like realm or DBFlow.

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

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 DataBinding library contributed by Google in Adapters for faster development, and added CustomBindingAdapter to handle downloading and caching images using Picasso library, which also use Google Palette 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 with Timber 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 new Google Firebase as application Analytics and CrashReport services.

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.


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

More Repositories

1

Android-Interview-Questions

Android Interview Questions
96
star
2

SvgToCompose

SVG path to Jetpack Compose tool
Kotlin
49
star
3

Android-PiP

Android Picture-in-Picture feature helper library
Kotlin
36
star
4

protobuf_android_sample

A sample Android application using protobuf
Kotlin
29
star
5

fyber_mobile_offers

Fyber Mobile Offers Android Application Assigned by Fyber
Java
21
star
6

itag

This Android application helps you to connect to an iTag BLE button and broadcast a message when button is pressed
Kotlin
13
star
7

trakt.tv

Trakt.tv Android Application Assigned by Trivago
Java
11
star
8

close-to-me

CloseToMe Android BLE library
Kotlin
11
star
9

Rick-and-Morty

Rick and Morty Android app
Kotlin
10
star
10

android-utils

Android Common Utils Library
Java
9
star
11

quandoo

Table Reservation Android Application Assigned by Quandoo GmbH
Java
6
star
12

AbcWatch

Android Wear OS ABC Watch app
Kotlin
6
star
13

weather_app

Weather Application Assigned by Friendsurance
Java
5
star
14

framer-android-wrapper

Framer Android Wrapper Application
Java
5
star
15

android-things-ble-sample

Android Things BLE Sample
Kotlin
4
star
16

brainrush

LineSquare Unity3D Game
C#
3
star
17

navigation-view

Android NavigationView
Java
3
star
18

app-settings

Android Shared Preferences wrapper
Kotlin
2
star
19

hacker_rank

HackerRank Challenges in Java
Java
2
star
20

aquaplay

AquaPlay Unity3d Game
Java
2
star
21

makethemfall

Make Them Fall Unity3D Game
C#
2
star
22

android-things-ble-sample-app

Android Things BLE Sample App using RxAndroidBle
Kotlin
2
star
23

stylight

Android Application Assigned by stylight
Java
2
star
24

tehran-traffic-map

Tehran Traffic Map Android Application
Java
2
star
25

bragi

Bragi Android Application Assigned by Bragi tech team
Java
2
star
26

IMA-Framework

Isolated Modules Architecture Framework documents and sample project
Kotlin
1
star
27

AndrodAudioTester

Android Audio I/O Tester
Kotlin
1
star
28

iran_mobile_congress

Iran Mobile Congress Android Application
HTML
1
star
29

control_ball

Controls Ball Unity3D Game
C#
1
star
30

insulin_reminder

Insulin Reminder Android Application
Java
1
star
31

MyApplication

Sample Android Application
Kotlin
1
star
32

market-price

Market Price Android Application - Number26 Task
Java
1
star
33

flappybird

FlappyBird Unity3D Game
C#
1
star
34

bcg

BCG Application Assigned by BCG Digital Ventures
Java
1
star
35

tehran_treasure_game

Tehran Treasure Android Game
Java
1
star
36

bom

Bill of Material sample project
Kotlin
1
star
37

game_worlds

XYRALITY sample project
Java
1
star
38

Android-Phone-ID

Android application which reviles device IDs including PhoneNumber, BluetoothName, ICCID, etc.
Kotlin
1
star
39

SOTI-IMEI

An Android app that receives IMEI on a SOTI managed device from MobiControl agent
Kotlin
1
star
40

doostjoo

Doostjoo Android Application
Java
1
star