0% found this document useful (0 votes)
17 views4 pages

Week-3 Answers

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Week-3 Answers

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

WEEK-3

1. Discuss about different types of Android Architecture.


Ans : There are several types of Android architecture patterns
in android. They are as follows:

Model-View-Controller (MVC) :
MVC pattern was first developed in 1970. As the name
describes itself, this pattern has three components - Model,
View, and Controller. The Model holds the main logic and
rules for how the data is changed and manipulated. View and
Controller both depend on the Model. View refers to the UI
layer. It allows you to see the data that is stored in the model.
The Controller acts as a request handler. It handles all the
incoming requests from the user and updates the model to
show what kind of data the user wants to see. The view
displays it on the screen. If the view follows the single
responsibility principle then its main role is to display the data
from the model for every user event handled by the controller.

Model-View-Presenter (MVP) :
Here the controller part is replaced by the presenter.
The Presenter is responsible for accepting all the incoming
inputs/requests from the user. It then transfers them to
the Model. The model accesses the data the user wants and
sends it back as a result to the View. Hence, the key task of the
presenter is to deal with all the UI events so that users can
retrieve their data. The role of model and view in MVP is the
same as in MVC. One of the assisting factors to the application
while using MVP is that the view is submissive. Its sole
purpose is to approve all user activities and transfer the rest of
the work to the presenter. Additionally, since all three parts are
separated, debugging becomes simpler because unit testing can
be done when other parts are still being developed.

Model-View-ViewModel (MVVM) :
In MVVM, the view is independent of the model. This means
that the UI part is separated from the core logic of the
application. It’s the job of the view model to retrieve the data
from the model and present them in the view. Also, the view
model carries out the computational work of the view by
handling the user events and updating the UI. This is because
in MVVM the view is responsible for notifying the view-
model about all the user action. As a result, we can assume that
View and View-Model has a two-way data binding
relationship.

2. Differentiate Explicit and Implicit Intent.


Ans : In Android there are two types of Intent. They are
• Implicit Intent
• Explicit Intent

Implicit Intent :
This intent specifies an action that can be invoked by any app
on the device which enables us to perform an action. It does
not have exact knowledge about the landing component. It can
open another app or its own app’s component and many other
options exist.
Examples: Downloaded song, PDF, image, document, dial call,
map location, etc.

Explicit Intent :
This intent specifies the component in an app. It is one that we
use to launch a specific app component, such as a particular
activity or service in our application. Using this intent we can
pass the data from one activity to another activity.
Examples: startActivity (know about which activity will start),
start service to download the file.

3. Create an android application which allows you to


navigate to two different websites from its home page.
Implement navigation to first website through implicit
intent and second using explicit intent.
Attached .apk file and zip file of the project.

You might also like