Chapter 1 Flashcards
Activity
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.
Why create subclasses of Activity?
to implement the functionality that your app requires. A simple application may need only one subclass. Complex applications can have many.
Layout
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.
Relationship between Activity and activity.xml
Activity manages what activity.xml defines
Android project
contains the files that make up an application.
why are packages uses a reserved DNS?
keeps package names unique and distinguish applications from each other on a device and on google play.
The different panes of the workbench window are called views (True/False)
True
Widgets
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.
Every widget is an instance of the view class or on of its subclasses (such as textview or button) (True/False)
True
purpose of string resource
a file in xml that is used as string references
How do XML elements in activity_quiz.xml become view objects?
none
purpose of onCreate(Bundle)
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)
public void setContentView(int layoutID);
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.
resource ID
specifies which layout to inflate.
organizing imports
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.