0

I want to know what is the role of presenters in Android application development? And where should I call the data APIs?

Should I send my data requests inside the presenter or inside the (fragment / activity)?

Also, what is the role of the fragment/activity in MVP?

If you have any resources in this matter, they will be appreciated.

Murtadha S.
  • 442
  • 6
  • 15

1 Answers1

1

It depends on your MVP variant.

But data requests go in your data classes, called from the Presenter. XXXDataManager for example. Where XXX is the model class you are fetching.

Fragment/Activity is usually regarded as dumb views in MVP.

Resource: https://medium.com/@cervonefrancesco/model-view-presenter-android-guidelines-94970b430ddf

Frank
  • 12,010
  • 8
  • 61
  • 78