Where to call for web API in Android MVP

559 views Asked by At

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.

1

There are 1 answers

0
Frank On BEST ANSWER

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