All Projects → nglauber → mvp-sample

nglauber / mvp-sample

Licence: other
Demonstrates how to implement MVP (Model View Presenter) pattern using Kotlin, RXJava, Retrofit, Dagger and DataBinding

Programming Languages

kotlin
9241 projects
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to mvp-sample

Android-Starter-Kit
This is up-to-date android studio project for native android application, that is using modern tools and libraries.
Stars: ✭ 16 (-54.29%)
Mutual labels:  mvp, mockito, dagger2, retrofit2, constraint-layout
Android tmdb clean architecture
Showcase of clean architecture concepts along with Continuous Integration and Development for modular Android applications. Includes test suits (functional and unit tests) along with code coverage.
Stars: ✭ 63 (+80%)
Mutual labels:  mvp, mockito, espresso, dagger2, retrofit2
Marvel
Marvel Characters Android Application Assigned by smava GmbH
Stars: ✭ 227 (+548.57%)
Mutual labels:  mvp, mockito, espresso, retrofit2
GuildWars2 APIViewer
Guild Wars 2 API Viewer: An Android application used for viewing various Guild Wars 2 API endpoint responses. Developed utilizing MVVM architecture, in conjunction with Databinding, Dagger 2, Retrofit 2, and RxJava 2.
Stars: ✭ 53 (+51.43%)
Mutual labels:  mockito, espresso, dagger2, retrofit2
Mvpandroid
Sample app to demonstrate MVP (Model - View - Presenter) architecture in android
Stars: ✭ 91 (+160%)
Mutual labels:  mvp, mockito, espresso, dagger2
Androidstarter
A sample Android app using the MVP architecture.
Stars: ✭ 140 (+300%)
Mutual labels:  mvp, mockito, dagger2, retrofit2
TDDWeatherApp
Android App trying to apply TDD and using MVVM, Kotlin Coroutines
Stars: ✭ 38 (+8.57%)
Mutual labels:  mockito, espresso, dagger2, retrofit2
Githubprojectbrowser
This is a sample Android Project that is based on Clean Architecture
Stars: ✭ 64 (+82.86%)
Mutual labels:  mockito, espresso, dagger2, retrofit2
Tvflix
TvFlix android app using Dagger Hilt, Coroutines, Flow, KTX, Jetpack(Room, ViewModel, Paging3, Lifecycle) based on MVVM architecture purely written in Kotlin
Stars: ✭ 286 (+717.14%)
Mutual labels:  mockito, dagger2, retrofit2, databinding
AndroidStarterAlt
A sample View-based Android app using the MVP architecture. It uses Mosby, Dagger2, RxJava, retrofit, LoganSquare, requery, EventBus, Conductor.
Stars: ✭ 27 (-22.86%)
Mutual labels:  mvp, mockito, dagger2, retrofit2
GithubApp-android-architecture
Let's learn a deep look at the Android architecture
Stars: ✭ 16 (-54.29%)
Mutual labels:  mvp, dagger2, retrofit2, constraint-layout
AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (+122.86%)
Mutual labels:  mvp, mockito, dagger2, retrofit2
Newspaper
An aggregated newspaper app containing news from 10+ local news publishers in Hong Kong. Made with ❤
Stars: ✭ 82 (+134.29%)
Mutual labels:  mockito, espresso, dagger2, retrofit2
Weather-Guru-MVP
Sample Material-design Android weather application build with MVP architectural approach using Dagger2, RxJava2, Retrofit2, Event-Bus, GreenDao, Butterknife, Lottie etc.
Stars: ✭ 15 (-57.14%)
Mutual labels:  mvp, mockito, dagger2, retrofit2
Mvvm Kotlin Android Architecture
MVVM + Kotlin + Retrofit2 + Hilt + Coroutines + Kotlin Flow + mockK + Espresso + Junit5
Stars: ✭ 1,014 (+2797.14%)
Mutual labels:  mvp, mockito, espresso, retrofit2
Aiyagirl
🔥 爱吖妹纸(含 Kotlin 分支版本)——Retrofit + RxJava + MVP 架构 APP 体验代码家的干货集中营 Gank.io,福利多多,不容错过
Stars: ✭ 1,109 (+3068.57%)
Mutual labels:  mvp, dagger2, retrofit2
Business Search App Java
Showcases object oriented programming in Java, Java Swing, Kotlin, and Android
Stars: ✭ 53 (+51.43%)
Mutual labels:  mvp, dagger2, retrofit2
Android Mvp Architecture
MVP + Kotlin + Retrofit2 + Dagger2 + Coroutines + Anko + Kotlin-Android-Extensions + RX-java + Mockk + Espresso + Junit5
Stars: ✭ 82 (+134.29%)
Mutual labels:  mvp, dagger2, retrofit2
Kotlinmvparchitecture
Clean MVP Architecture with Dagger2 + Retrofit2 + Mockito + Fresco + EasiestGenericRecyclerAdapter using Kotlin. Added Unit Tests(Kotlin Tests)!
Stars: ✭ 143 (+308.57%)
Mutual labels:  mvp, dagger2, retrofit2
Bigbang
Android base project used by Xmartlabs team
Stars: ✭ 47 (+34.29%)
Mutual labels:  mvp, dagger2, retrofit2

mvp-sample

Demonstrates how to implement MVP (Model View Presenter) pattern using Kotlin, RXJava, Retrofit, Dagger and DataBinding

Setup

I just cloned this project... how do I run this? Read on!

Client

Right after importing the project you will notice that it fails to compile due to a missing google-services.json file error. This project uses Firebase authentication and that file is required.

Why isn't google-services.json in github?

Quoting Sam here:

The general answer is yes, the google-services.json is safe to check in to your repo and is something that should be shared among engineers on your team. The JSON file does not contain any super-sensitive information (like a server API key). It does contain some information like your database URL, Android API key, and storage bucket. These are not secrets, but if your security rules are not set up correctly an attacker could use them against you. However since these values are also compiled into your APK as resources, the theoretical attacker would not need your JSON file to get these values anyway.

For a library or open-source sample we do not include the JSON file because the intention is that users insert their own to point the code to their own backend. That's why you won't see JSON files in most of our firebase repos on github.

So how do I get a google-services.json file to use with this project?

You need to create your own firebase project, which is luckily very easy to do:

  1. Create a new Firebase project in your Firebase console https://console.firebase.google.com/
  2. Choose a name for your project like MVPSample
  3. Then choose "Add Firebase to your Android app"
  4. And complete with the following:
    • Android package name: br.com.nglauber.exemplolivro
    • App nickname (optional): MVPSample
    • Debug signing certificate SHA-1: The SHA-1 in your debug.keystore (see here if you don't know how to get this exactly)
  5. Lastly click in the Authentication section SIGN-IN METHOD tab and make sure you at least enable Google as a Sign-in provider. You can also enable Facebook but that requires a little bit more setup so feel free to skip initially.

Server

The client app can either store data in a local database or it can post it to a local server. A basic PHP server is provided under folder server that you can use to run this sample.

Pre-requisites to launch the server

  • PHP Installed
  • MySql Installed

Under mvp-sample/server run:

$ php -S {your_local_ip}:{your_port} 

Do not use "localhost" for {your_local_ip}

Example:

php -S 192.168.1.104:8000

Make sure you can reach your server by opening this URL in your browser:

http://{your_local_ip}:{your_port}/webservice.php

Example:

http://192.168.1.104:8000/webservice.php

You should get a blank page with just a pair of square brackets: []

In the app's build.gradle file you can specify the SERVER_PATH you chose, like this:

buildConfigField "String", "SERVER_PATH", "\"http://192.168.1.104:8000/\""

Tests

Before running the tests you should grant READ_EXTERNAL_STORAGE permissions to the app with adb from the command line:

$ adb shell pm grant br.com.nglauber.exemplolivro android.permission.READ_EXTERNAL_STORAGE

DataSource

You can switch the DataSource from PostWeb to PostDb in PostsModule.kt

    @Provides
    fun providesDataSource(user : User?) : PostDataSource {
        //return PostWeb(user?.uuid, application)
        return PostDb()
    }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].