{"id":13613634,"url":"https://github.com/derohimat/android-base-mvp","last_synced_at":"2025-04-13T15:33:38.362Z","repository":{"id":68377328,"uuid":"64722834","full_name":"derohimat/android-base-mvp","owner":"derohimat","description":"Android Base MVP Concept with RXJava, Dagger, Event Bus, Retrofit, Glide, OkHTTP","archived":true,"fork":false,"pushed_at":"2018-07-18T03:46:52.000Z","size":579,"stargazers_count":145,"open_issues_count":1,"forks_count":40,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-07T21:42:46.561Z","etag":null,"topics":["android","architecture","dagger","example-project","mvp","mvp-concept","okhttp","rxjava","sign"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derohimat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-08-02T03:59:16.000Z","updated_at":"2024-05-07T13:27:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"8efcb73d-8d8f-41a5-913b-0a8e48051f45","html_url":"https://github.com/derohimat/android-base-mvp","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derohimat%2Fandroid-base-mvp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derohimat%2Fandroid-base-mvp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derohimat%2Fandroid-base-mvp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derohimat%2Fandroid-base-mvp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derohimat","download_url":"https://codeload.github.com/derohimat/android-base-mvp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248736321,"owners_count":21153577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","architecture","dagger","example-project","mvp","mvp-concept","okhttp","rxjava","sign"],"created_at":"2024-08-01T20:00:51.979Z","updated_at":"2025-04-13T15:33:33.348Z","avatar_url":"https://github.com/derohimat.png","language":"Java","funding_links":[],"categories":["Android"],"sub_categories":[],"readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Base%20MVP%20Concept-blue.svg?style=flat)](https://android-arsenal.com/details/1/4213)\n\n[ ![Download](https://api.bintray.com/packages/derohimat/BaseApp/android-base-mvp/images/download.svg?version=2.0.1) ](https://bintray.com/derohimat/BaseApp/android-base-mvp/2.0.1/link)\n\n# Android Base MVP Concept\n\n### Architecture\n\u003cimg src=\"https://github.com/derohimat/android-base-mvp/blob/master/architecture_diagram.png\"\u003e\n\n### Requirements :\n\tMin SDK Version 15\n\tTarget SDK Version 27\n\tCheck the compileSdkVersion, and buildToolsVersion to be the latest\n\tBuild Tools Version 27.0.3\n\tJava 1.8\n\n### Step by step\n\nStep 1. Add it in your root build.gradle at the end of repositories:\n\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url \"https://jitpack.io\" }\n\t\t}\n\t}\n\nStep 2. Add the dependency\n\n\tdependencies {\n\t        compile 'com.github.derohimat:android-base-mvp:1.0'\n\t}\n\nStep 3. Add this library for version **0.4 and up**\n\n\t//----- The core of Reactive Programming\n    compile 'io.reactivex:rxjava:1.2.5'\n    compile 'io.reactivex:rxandroid:1.2.1'\n\nStep 4. Change **```extends MvpView```** to **```extends BaseView```**\n\nStep 5. Modify applicationId \"**net.derohimat.samplebasemvp**\" to your package name\n\nStep 6. Profit\n\nStep 7. Star this repository :)\n\n## How to implement a new screen following MVP\n\nImagine you have to implement a sign in screen.\n\n1. Create a new package under ui called signin\n2. Create an new Activity called **```ActivitySignIn```**. You could also use a Fragment.\n3. 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()```**\n4. Create a **```SignInPresenter```** class that extends **```BasePresenter\u003cSignInView\u003e```**\n5. 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()```**.\n6. Create a **```SignInPresenterTest```** and write unit tests for **```signIn(email)```**. Remember to mock the **```SignInView```** and also the DataManager.\n7. Make your **```ActivitySignIn implement SignInView```** and implement the required methods like **```showSignInSuccessful()```**\n8. 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)```**.\n\n### Library :\n  - [Retrofit 2](http://square.github.io/retrofit/)\n  - [OkHTTP 3](http://square.github.io/okhttp/)\n  - [RXJava](https://github.com/ReactiveX/RxJava)\n  - [Dagger 2](http://google.github.io/dagger/)\n  - [Event Bus](https://github.com/greenrobot/EventBus)\n  - [XRecyclerView](https://github.com/jianghejie/XRecyclerView)\n  - [Butterknife 7](https://github.com/JakeWharton/butterknife)\n\n\n### Inspired by\n\nhttps://github.com/AndreiD/UltimateAndroidTemplateRx\n\nhttps://github.com/zetbaitsu/Benih\n\n\n### License\n    Copyright 2016 Deni Rohimat\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderohimat%2Fandroid-base-mvp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderohimat%2Fandroid-base-mvp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderohimat%2Fandroid-base-mvp/lists"}