From the course: Android App Development: Design Patterns for Mobile Architecture
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create presenter - Android Tutorial
From the course: Android App Development: Design Patterns for Mobile Architecture
Create presenter
- [Instructor] We've just had the application overview and now we're ready to start moving into an MVP type architecture. And the first thing to do is to move all the logic outside of your activities into presenters or view-models, or whatever you want to call them. I'm going to call it a presenter. So we know that this is a spy list. So I'll just come in here and say, New Class SpyListPresenter. We'll come back to here and just make sure that we have a presenter, private SpyListPresenter, we'll just say there, and we'll just new one up right now in line, eventually we'll be injecting that. Now there's a few things that we already know aren't going to be in here. Anything that does data translation, the realm is our actual database instance, and Gson is our JSON conversion, which is apart of translation. So we'll move these over to the presenter. Come back to here, probably be renaming some methods. Helper methods aren't going to really move those over. Data specific to this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.