antoniolg / androidmvp

MVP Android Example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More advanced use cases

Knight704 opened this issue · comments

Could you share some tips for more advanced scenarios.
By this I mean cases, when we should somehow interact with android framework layer.
Let's say we wanted to login via Google Signin (from Google Play Services), this approach requires GoogleApiClient and tightly coupled to method onActivityResult. This is just an example, for simplicity it could be slightly changed.

From my point of view example provided is great, very simple and intuitive, but when it comes to real use cases, questions appears.

Cheers.

I'd love to, but honestly I probably won't have time. This example was created two years ago, where almost nobody had talked about MVP on Android, so it required a very simple example to be understood. But nowadays I'm sure there are more complex examples out there.

Anyway, if I have some time, your idea for an example looks great to me.

antoniolg, thanks for your demo;

When reading the code, I kind of stuck with LoginInteractor and LoginInteractorImpl,
because as far as my knowleged is concerned, I found them redundant.
So can we remove them and do login logic directly under LoginPresenterImpl ?
If not , can you explain why ?

Cheers.

Yes, the LoginInteractor here is not necessary, you can omit it.

@micromingle , I think the reason for separating the LoginInteractor and LoginInteractorImpl is to separate the model logic (as outlined in LoginInteractor) from its implementation (LoginInteractorImpl). This may seem redundant if you consider only a single platform (Android), but in a multi-platform project, the model logic would be the same for all platforms and the implementation would be different.

@alinhayati yeah, that makes perfect sense