Questions tagged [android-mvp]

On Android, MVP is a way to separate background tasks from activities/views/fragments to make them independent of most lifecycle-related events. This way an application becomes simpler and code maintainability becomes better. Use this tag if your question is specifically about using MVP in Android.

On Android, MVP is a way to separate background tasks from activities/views/fragments to make them independent of most lifecycle-related events. This way an application becomes simpler and code maintainability becomes better. Use this tag if your question is specifically about using MVP in Android.

The tag should be used along with

278 questions
0
votes
1 answer

Can comparison logic be kept in Activity under MVP Pattern

I am new to Android and trying to learn MVP pattern. I have wrote below sample tutorial which fetches username and password from EditText and see if it matches "Don" and "Bradman". If yes it will show Toast message accordingly. My Question is "Is it…
Golmaal
  • 13
  • 5
0
votes
1 answer

How do I pass SQLite Cursor from MVP Model to View without breaking Presenter?

I have an app implementation using the MVP design, and I want to use a SQLlite database to source data data to the UI View. I don't want/need to use a ContentProvider as the data is only required by my app alone. I know that the View should be…
Simon Hutton
  • 1,677
  • 3
  • 22
  • 35
0
votes
0 answers

Call Fragments presenter's method from Activity [Dagger 2 + MVP]

I have 2 different fragments and they both will be using by 2 different activities. In both activity's layout there is one frame layout to use as fragment container. Which are; Fragments: MapFragment, ListFragment Activities: HomeActivity,…
Murat
  • 415
  • 7
  • 17
0
votes
0 answers

Error adding Room Persistence to module

This is what my gradle looks like, I have commented out the problem line (Updated with full gradle code) data-layer apply plugin: 'java' dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':models') …
Olay
  • 43
  • 3
  • 7
0
votes
1 answer

How to design a class that can pass data from server when data is finish downloading

I'm new on Android development and I'm learning how to use MVP pattern correctly in recently. Now I'm facing a tricky problem, hope can get some helpful suggestion or solution from here. First, here is my presenter public class MVPPresenter { …
Lucian
  • 3
  • 2
0
votes
1 answer

MVP and multiple behaviours

I've been trying to make a simple notepad app (my first app), using MVP and dagger. I've understood most of the stuff but I'm a little bit lost if I have multiple behaviors. I'll explain. My project hierarchy goes like this : Click here…
0
votes
0 answers

Dagger2 merge components for MVP

I have a current application where i'm trying learn MVP and Dagger2 by practice but i must be missing something. I have the following classes: [MVP] LoginActivity (View) public class LoginActivity extends AppCompatActivity implements…
Carlos Ferreira
  • 432
  • 5
  • 15
0
votes
1 answer

Fatal Exception thrown on Scheduler - rxJava2 in Android

I'm introducing myself to rxJava2 in Android with MVP. For initial steps I have created an Activity, a presenter and a Model objects (every of them with an interface class). In my activity, I create the presenter, and try to load data, notifying the…
Alex_ES
  • 205
  • 2
  • 15
0
votes
1 answer

Android MVP: handling changes to RecyclerView

When using a RecyclerView in an Android app, many posts and tutorials have the Adapter handle managing the updates to the list, using solutions like DiffUtil. This does not seem to follow MVP, however, as the Adapter exists in the View layer. So,…
0
votes
1 answer

Presenter cannot be provided without an @Provides- or @Produces-annotated method | Android | Dagger 2

I am working with Viper MVP Code architecture - When i compile the code i am getting this error- Error:(32, 10) error: com.tv.goin.activities.login.LoginMvpPresenter
Shoeb Siddique
  • 2,805
  • 1
  • 22
  • 42
0
votes
2 answers

Firebase not getting data from onDataChange method

I understand that Firebase gets the data asynchronously and I'm trying to set the data before it gets loaded into my recyclerView adapter so that it shows up in the recyclerview. But when I launch the app, it only gets the "EMPTY" string that I…
0
votes
1 answer

MVP's Model vs Interactor from Clean architecture

I'm using MVP pattern in my apps and lately I've been reading about Clean Architecture. One thing I don't really understand is this : what's the difference between Model in MVP and Interactor ? My understanding is that an Interactor is just a…
Mes
  • 1,671
  • 3
  • 20
  • 36
0
votes
1 answer

How to manage presenter dependencies while using Dagger/MVP?

I have a Presenter which has multiple dependencies that are provided by the ApplicationComponent. Now the general pattern I've used is to use an @Inject constructor for the presenter. But I have a case where the presenter has around 6…
Anoop
  • 1,307
  • 1
  • 14
  • 27
0
votes
0 answers

Sorting multiple lists in android by multiple properties

Let's jump directly to the topic! Here's the thing: I've got an android app using mvp pattern. There's an activity containing two fragments which are tabs and both of them are lists. Both fragments share the same Database Interactor and a…
v1t0
  • 23
  • 7
0
votes
2 answers

dagger2 constructor injection how to provide dependency without module

I've read that constructor injections don't require a module. So I have this questions. If I have this constructor injection: private Model realmModel; @Inject public MainActivityPresenter(Model realmModel) { this.realmModel =…
nani
  • 382
  • 5
  • 15