android-mvp

Can I register MVP Presenter inside Fragment

∥☆過路亽.° 提交于 2019-12-03 12:00:46
问题 I've been following MVP design pattern provided by Google to refactor my application. I have one MainActivity and many Fragments and it seems little be messy for me to create an activity for every fragment, so I've been thinking to register presenter in fragment. What I'm seeing is that every fragment register its own presenter, but I'm not sure how much wrong it is... :) So here is my Presenter: public class FirstPresenter implements FirstContract.Presenter { private final FirstContract.View

What role an Android Service should play in the MVP pattern?

让人想犯罪 __ 提交于 2019-12-03 02:52:46
I am developing an Android app that does Human Activity Recognition. It basically works like that - Service constantly reads the accelerator data and stores the recognized activity (i.e. Walking, running) in a database. The user can see all of the recognized activities in an ListView in activity (accesses the database). Every User table in the database has a pa_goal (physical activity goal) field which the Service reads from the database and does some checks. The user, of course, can change this goal from an activity. Since I will be implementing the MVP architectural pattern. I am unsure

Can I register MVP Presenter inside Fragment

限于喜欢 提交于 2019-12-03 02:26:01
I've been following MVP design pattern provided by Google to refactor my application. I have one MainActivity and many Fragments and it seems little be messy for me to create an activity for every fragment, so I've been thinking to register presenter in fragment. What I'm seeing is that every fragment register its own presenter, but I'm not sure how much wrong it is... :) So here is my Presenter: public class FirstPresenter implements FirstContract.Presenter { private final FirstContract.View mView; public FirstPresenter(FirstContract.View view) { mView = view; } @Override public void start()