St.Antario
St.Antario

Reputation: 27445

Does Android SDK suggested with MVP design pattern?

I've read about MVP design pattern and have some question about it.

If we consider Android SDK we can suggest that an Activity is a Presenter which takes over event handling, lifecycle events executing and communication with data-layer which can be a SharedPreferences, SQLlite etc. View in that case is just xml- view description which doesn't contain any event handlers or other user-communication things.

But I'm doubt if my reasoning correct at all? Could you help me to understand?

Upvotes: 0

Views: 258

Answers (1)

N Sharma
N Sharma

Reputation: 34507

Android also follow MVC architecture.

1) In Android activity is the controller where you write a code for handling input & response.

2) xml layouts represent the view where you describe the presentation part of the application.

3) & model is your java pojo classes. For instance Person class which has two attributes first name & last name.

Upvotes: 1

Related Questions