Question: I can't get my head around how to apply the model-view-controller design pattern in an android studio project.

I understand that the view is the .xml layouts and that the activity classes are supposed to be the controllers, but I'm confused about whether general programming logic should be a part of the controller or model.

Can the programming logic related to a particular activity be included within the activity class or should they be separated into two classes? i.e. the activity handling just user input and a second class dealing with the associated programming logic.

Answer: 
hello @Somebloke It is as simple as its name.

1. Android Project Structure means the necessary file that are using to developed an Android Application. for example src file, gen file etc.
	* src: This folder contains the Java source files
	* gen: Generated Java library, this library is for Android internal use only.
	* Res: Here we can store resource files such as pictures, XML files for defining layouts, and so forth. Within this folder there are additional folders such as Drawable, Layout, and Values.
	* AndroidManifest.xml: This is the Android definition file. It contains information about the Android application such as minimum Android version, permission to access Android device capabilities such as INTERNET access permission, ability to use phone permission, etc.

2.MVC :- It is one of the structure that are used developed an Android Application.

* ***Model*** -- The data layer, responsible for managing the business logic and handling network or database API.
* ***View*** --the UI layer — a visualization of the data from the Model.
* ***Controller*** --the logic layer, gets notified of the user’s behavior and updates the Model as needed.[![enter image description here](https://i.stack.imgur.com/J98tr.png)](https://i.stack.imgur.com/J98tr.png)

you can take this one as an example <https://github.com/hkusu/android-mvc-sample>
An architecture decision could be:

* Whether the application is expected to function online or offline?
* When packaging an application, how should you distribute top-level packages in the codebase?
* Dependency injection.
* Unit testing.

Architecture is our attempt to manage risks involved in changing requirements. As with any other risk-management activity, we cannot be prepared for all the possible risk that can come into play. We need to choose a subset of possible future changes that we are optimizing our application for, and this subset will constitute the application architecture.

Here is a knowledge base to get started, you should make your own project and implement these software architectures in order to adopt the one that works for you and your project:

[Android Architecture Blueprints](https://github.com/googlesamples/android-architecture)

[![Android Architecture Blueprints](https://i.stack.imgur.com/72yfM.png)](https://i.stack.imgur.com/72yfM.png)

[Reactive Apps with MODEL-VIEW-INTENT - PART1 - Model](http://hannesdorfmann.com/android/mosby3-mvi-1)

[![enter image description here](https://i.stack.imgur.com/ItwJT.gif)](https://i.stack.imgur.com/ItwJT.gif)