Skip to content

This project demonstrates Model-View-Presenter pattern + Dagger + Retrofit usage in android.

Notifications You must be signed in to change notification settings

niharika2810/MVP-Dagger-Retrofit-Sample-App

Repository files navigation

MVP-Dagger-Retrofit-Sample-App

This project demonstrates Model-View-Presenter pattern + Dagger + Retrofit usage in android.

Model–view–presenter (MVP) is a derivation of the model–view–controller (MVC) architectural pattern which mostly used for building user interfaces. In MVP, the presenter assumes the functionality of the “middle-man”. In MVP, all presentation logic is pushed to the presenter. MVP advocates separating business and persistence logic out of the Activity and Fragment.

Dagger 2 is dependency injection framework. It is based on the Java Specification Request (JSR) 330. It uses code generation and is based on annotations. The generated code is very relatively easy to read and debug.

Retrofit is type-safe REST client for Android and Java which aims to make it easier to consume RESTful web services.

Following notable libraries have been used in this project

  1. Retrofit 2 for API interaction
  2. Dagger 2 for dependency injection.

I have used Dagger SubComponents to pass dependencies down in dependency graph.

Some nice articles for learning Dagger 2 :

  1. Dependency Injection with Dagger 2- CodePath
  2. Dependency injection with Dagger 2 - the API
  3. Introduction to Dagger 2, Using Dependency Injection in Android: Part 2
  4. An Introduction to Dagger 2 (Android DI) – Part 1

Happy Coding!!

About

This project demonstrates Model-View-Presenter pattern + Dagger + Retrofit usage in android.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages