Chapter 2 Flashcards

1
Q

MVC

A

labeled model, controller, and view. architecture android applications are designed around. MVC states that any object in your application must be a model object, a view object, or a controller object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

model object

A

holds the applications data and ‘business logic’. have no knowledge of the user interface; their sole purpose is holding and managing data. EX: a user, a product in a store, a photo on a server, or a television show, or a true-false question. compose the model layer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

view objects

A

know how to draw themselves on the screen and how to respond to user input, like touches. simple rule of thumb is that if you see it on screen, then it is a view. view layer consists of the widgets that are inflated from activity.xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Controller objects

A

tie the view and model objects together. they contain ‘application logic’. Designed to respond to various events triggered by view objects and to manage the flow of data to and from model objects and the view layer. Controller layer, at present, consists solely of QuizActivity (class extending Activity).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

MVC flow with user input

A

user interacts with view object. View sends message to controller. Controller updates model objects. Controller takes data from model objects that its views are interested in. Controller updates view with changes in model objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Benefit of MVC

A

helps you design and understand an application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

mdpi

A

medium-density screens (~160dpi)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

hdpi

A

high-density screens (~240dpi)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

xhdpi

A

extra-high density screens (~320dpi)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

why the R.java file contains only two resource ID’s for png in mdpi, hdpi, and xhdpi?

A

all you have to do is use this resource ID. when the app is run, the OS will determine the appropriate image to display on that particular device.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

add imagebutton instead of button

A

change xml button to imagebutton. remove text, padding, drawable attributes and add src and contentdescription attributes. also change the button objects in your java code to imagebutton objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly