Help me here please I am using the MVP architectur...
# android
o
Help me here please I am using the MVP architecture, the fragments are used as the View component of the MVP. What about my activities ? What should they stand for in the MVP ?
r
Both the Activity and fragment are the View
and they both need separate presenter
o
@rkeazor And I’ll have two View interfaces then ? one for the activity and one for the fragment ?
r
yep
o
Many thanks bro 👍 By the way, do you know any github projects or video explanation doing like so ?
r
A good resource is on caster.io
they have a good series on it
o
You mean this course Mode View Presenter with Android https://caster.io/courses/mvp/ ??
I really appreciate your help 🙏
r
no prob dude
r
@ossama hey, do you still have a problem?
o
Hey @radityagumay It's ok. Thanks But if you have any additional helpful information, I'd be so grateful
r
https://github.com/radityagumay/contactapp i create this repository to showcase MVP works
in context in android, both of Fragment and Activity are views.
In many cases, i prefer using a fragment as a layout inflated, then a activity only for a container for a fragment (i know other people using a fragmentless approach). why should using a fragment instead of directly using activity? Using a fragment have advantages, you can create a modular ui component for it. lets says, you have has growing and business need, to extend app to tablet. if you using a fragment in previous development, you can easily extend you current code. using modular component also, make your code has single responsibility.
o
Thanks a lot @radityagumay
r
You welcome