• This repository has been archived on 28/Oct/2020
  • Stars
    star
    144
  • Rank 254,700 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated about 6 years ago

Reviews

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

Repository Details

Android Base MVP Concept with RXJava, Dagger, Event Bus, Retrofit, Glide, OkHTTP

Android Arsenal

Download

Android Base MVP Concept

Architecture

Requirements :

Min SDK Version 15
Target SDK Version 27
Check the compileSdkVersion, and buildToolsVersion to be the latest
Build Tools Version 27.0.3
Java 1.8

Step by step

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Step 2. Add the dependency

dependencies {
        compile 'com.github.derohimat:android-base-mvp:1.0'
}

Step 3. Add this library for version 0.4 and up

//----- The core of Reactive Programming
compile 'io.reactivex:rxjava:1.2.5'
compile 'io.reactivex:rxandroid:1.2.1'

Step 4. Change extends MvpView to extends BaseView

Step 5. Modify applicationId "net.derohimat.samplebasemvp" to your package name

Step 6. Profit

Step 7. Star this repository :)

How to implement a new screen following MVP

Imagine you have to implement a sign in screen.

  1. Create a new package under ui called signin
  2. Create an new Activity called ActivitySignIn. You could also use a Fragment.
  3. Define the view interface that your Activity is going to implement. Create a new interface called SignInView that extends BaseView. Add the methods that you think will be necessary, e.g. showSignInSuccessful()
  4. Create a SignInPresenter class that extends BasePresenter<SignInView>
  5. Implement the methods in SignInPresenter that your Activity requires to perform the necessary actions, e.g. signIn(String email). Once the sign in action finishes you should call getView().showSignInSuccessful().
  6. Create a SignInPresenterTest and write unit tests for signIn(email). Remember to mock the SignInView and also the DataManager.
  7. Make your ActivitySignIn implement SignInView and implement the required methods like showSignInSuccessful()
  8. In your activity, inject a new instance of SignInPresenter and call presenter.attachView(this) from onCreate and presenter.detachView() from onDestroy(). Also, set up a click listener in your button that calls presenter.signIn(email).

Library :

Inspired by

https://github.com/AndreiD/UltimateAndroidTemplateRx

https://github.com/zetbaitsu/Benih

License

Copyright 2016 Deni Rohimat

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

KioskMode-Android

Screen Pinning Android Lollipop with enable Device Administrator without Root needed
Java
64
star
2

FirebaseAuthExample

Example Sign In, Sign Up with Email, Facebook, Twitter using Firebase combine with BaseMVP (https://github.com/derohimat/android-base-mvp)
Java
21
star
3

ThermalPrinterBluetooth

Java
6
star
4

Firebase-DevCember

#DevCember2016
Java
5
star
5

AndroidStudioSettingsMac

Android Studio Settings for Mac
4
star
6

SunshineBTP

Customize Lesson 1 - 4 Udacity Android Intermediate Level with Retrofit 2.0, Realm
Java
3
star
7

GeuraLaundry

SISFO & Antar Jemput Laundry (Kelompok 5 - IF Widyatama 2016)
C#
2
star
8

Football-Schedule

Kotlin
2
star
9

ImageDoubleTapZoom

DoubleTapZoom Android Image View
2
star
10

FirebaseAssistant

firebase example using firebase assistant android studio
2
star
11

SampleIntent

Sample Intent Dicoding Academy
Java
1
star
12

android-twitter-libs

android twitter oauth library
Java
1
star
13

nanodegree-popular-movies-stage2

Udacity Nanodegree Popular Movies Stage 2
Java
1
star
14

Football-KADE

Football Kotlin Android Developer Expert
Kotlin
1
star
15

baking-app-p3

Udacity Associate Android Developer Fast Track
Java
1
star
16

HitungLuas

Hitung Luas dari Dicoding Academy
Java
1
star
17

FlexibleUI

Dicoding Academy Flexible UI
Java
1
star
18

Alpro2TugasFileCpp

Algoritma Pemrograman 2 Tugas File Cpp
C++
1
star
19

MyAppPortfolio

My App Portfolio Udacity Nanodegree
Java
1
star
20

DevFest-Bdg-Barcode-Scanner-with-MLkit

Kotlin
1
star
21

InfoPanganJakarta

info pangan jakarta (unoficial) data from http://infopangan.jakarta.go.id/
1
star
22

GScriptReadSpreadsheet

Google Script read data from Spreadsheet for android client can see here https://github.com/derohimat/DscUtamaWorkshopMakers
JavaScript
1
star
23

SgPSI

IMD Global Service Test
Java
1
star
24

AndroidSupportDesignSample

android material template
Java
1
star
25

MaterialTab

Dicoding Academy Material Tab (Fragment)
Java
1
star
26

DscUtamaWorkshopMakers

for gsheet api can see here https://github.com/derohimat/GScriptReadSpreadsheet
Java
1
star
27

BaseMvpKotlin

Kotlin
1
star
28

FlutterExercise

Flutter Exercise
Dart
1
star
29

ProposalStrukturData

1
star