Android Programming – GUI Architecture of Android Questions and Answers

Q-1 Explain GUI Architecture of android.

 

Android GUI is single-threaded, event-driven and built on a library of nestable components.

The Android UI framework is organized around the common Model-View-Controller pattern.

It provides structure and tools for building a Controller that handles user input (like key presses and screen taps) and a View that renders graphical information to the screen.

 

The Model: The model represents data or data container. We can see it as a database of pictures on our device. Let’s say, any user wants to hear an audio file, he clicks play button and it triggers an event in our app, now the app will get data from data store or database and as per input and creates data to be sent back to the user. We can refer this data as Model.

 

The View: The View is the portion of the application responsible for rendering the display, sending audio to speakers, generating tactile feedback, and so on.

Now as per above example, the view in a hypothetical audio player might contain a component that shows the album cover for the currently playing tune. User will always interact with this layer. User action on this layer will trigger events that will go to the application functions.

 

The Controller: The Controller is the portion of an application that responds to external actions: a keystroke, a screen tap, an incoming call, etc. It is implemented as an event queue. On User’s action, the control is passed over to controller and this will take care of all logic that needs to be done and prepare Model that need to be sent to view layer.