Chapter 1 Flashcards

1
Q

Activity

A

instance of Activity, a class in the Android SDK. Responsible for managing user interactions with a screen of information. Main class user see when they run an application. provide gui to the user and this enables user to give and receive to and from an application.

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

Why create subclasses of Activity?

A

to implement the functionality that your app requires. A simple application may need only one subclass. Complex applications can have many.

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

Layout

A

set of user interface objects and their position on the screen. A layout is made
up of definitions written in XML. Each definition is used to create an object that appears on
screen, like a button or some text.

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

Relationship between Activity and activity.xml

A

Activity manages what activity.xml defines

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

Android project

A

contains the files that make up an application.

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

why are packages uses a reserved DNS?

A

keeps package names unique and distinguish applications from each other on a device and on google play.

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

The different panes of the workbench window are called views (True/False)

A

True

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

Widgets

A

building blocks you use to compose a user interface.A widget can show text or
graphics, interact with the user, or arrange other widgets on the screen. Buttons, text input controls, and
check boxes are all types of widgets.

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

Every widget is an instance of the view class or on of its subclasses (such as textview or button) (True/False)

A

True

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

purpose of string resource

A

a file in xml that is used as string references

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

How do XML elements in activity_quiz.xml become view objects?

A

none

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

purpose of onCreate(Bundle)

A

method called on when an instance of activity is created. it needs a user interface to manage so it calls the Activity method: setContentView(int layoutResID)

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

public void setContentView(int layoutID);

A

used to inflate a layout and puts it on screen. when a layout is inflated, each widget in the layout file is instantiated as defined by its attributes by the LayoutInflator class. attributes allow you to configure a widget.

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

resource ID

A

specifies which layout to inflate.

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

organizing imports

A

ask eclipse to look at your code and determine what you need from the java and android SKD’s. it imports what you need and removes any previously imported classes that you are no longer using.

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

what does it mean to say android applications are typically event-driven?

A

driven applications start and then wait for an event, such as the user pressing a button.

17
Q

toast

A

short message that informs the user of something but does not require any input or action.

18
Q

In makeToast(..), you pass the instance of QuizActivity as the Context argument. Why cant you simply pass the ‘this’ isntead of QuizActivity.this?

A

At this point in the code, you are defining the anonymous class where this refers to the View.OnClickListener.