Android Development Flashcards

1
Q

what makes up the ANDROID SYSTEM ARCHITECTURE?

A
Applications
Application Framework
Libraries
Android Runtime
Linux Kernel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a VIEW?

A

The base class create Interactive UI Components

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

What is the CONTENT PROVIDER?

A

It allows the user to access information from another application

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

What is the RESOURCE MANAGER?

A

Provides access to non-code resources such as localised strings, graphics and layouts

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

What is the NOTIFICATION MANAGER?

A

Displays custom alerts

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

What is the ACTIVITY MANAGER?

A

This manages the lifecycle of an application

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

What is ANDROID RUNTIME?

A

A java code which implements the Android Application Programming Interface for UI data access, and other platform features.

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

What is the LINUX KERNEL?

A

Operating System used by LINUX family.

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

What is SDK and what does it provide?

A

Software Developer’s Kit, and it provides the API (Application Programming Interface) libraries and developer tools

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

RelativeLayout: …

A

to specify the location of child objects relative to each other.

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

xmlns:android=“…”: …

A

to define the XML namespace to reference part of the Android SDK.

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

android:layout_width/height=”match_parent”:…

A

to make the width as wide/high as it can be within the parent.

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

android:paddingBottom/Left/Right/Top=“16dp”: …

A

to set the padding, in pixels, of the bottom/left/right/top edge.

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

tools:context=“com…MainActivity”:

A

to find the right theme based on the activity.

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

android:layout_width/height=“wrap_content”:

A

to display the item wide/high enough to enclose its content.

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

android:text=“…”:

A

to display the text.

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

android:id=“@+id/phone_icon” :

A

The id attribute defines the unique identifier for the view in the Android system.

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

android:layout_width=“wrap_content”:

A

Informs the Android system to only take up as wide as needed to show the view.

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

android:layout_height=“wrap_content”:

A

Informs the Android system to only take up as high as needed to show the view.

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

android:layout_gravity:

A

This defines how to place the view, both its x- and y-axis, with its parent.

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

android:src=“@drawable/phone_on”:

A

This is a direct child of the ImageView class. One can use this to set the image that they wish to see on the screen.

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

What are Event Listeners:

A

This is an object that receives notification when an event happens, using the View class to build up an Android GUI.

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

What is Event Listeners Registration:

A

This is a process by which an Event Handler is registered with an Event Listener.

24
Q

What are Event Handlers:

A

A method to handle the event.

i.e. onClick(), onTouch(), onMenuItemClick()

25
Q

How would one link a Java Button reference (sButton) to an XML Button(button_1)?

A

Button sButton = (Button) findViewById(R.id.button_1);

26
Q

What is an Activity?

A

A single focused thing a user can create, application can consist of many. Each Activity is implemented as an implementation of the Activity Base Case

27
Q

What are the possible Stages of an activity?

A
On Create()
On Start()
On Resume()
On Pause()
On Stop()
On Destroy()
On Restart()
28
Q

What does the Bundle SavedInstanceState() do?

A

Gives the developer a way to pass information back and forth between screens what is known as a bundle

29
Q

What does the super.onCreate(savedInstanceState)() do?

A

Calls to the base Activity class to perform setup work to build the MainActivity Class

30
Q

What does the setContentView(R.layout.activity_main) do?

A

Referes to the activity_main.xml file that is located in the res/layouts directory.

31
Q

What is a sensor in Android Application?

A

A built-in component that measures motion, orientation and various environmental conditions
i.e. motion/position/environmental

32
Q

Which Sensors are hardware dependent?

A
Accelerometer
Ambient Temperature
Gyroscope
Light
Magnetic Field
Linear_Acceleration 
Gravity
33
Q

Which Sensors are software dependent?

A

Orientation
Linear_Acceleration
Gravity

34
Q

What is the Sensor Manager Class?

A

You can use this class to create an instance of the sensor service. This class provides various methods for accessing and listing sensors, registering and unregistering sensor event listeners, and acquiring orientation information. This class also provides several sensor constants that are used to report sensor accuracy, set data acquisition rates, and calibrate sensors.

35
Q

What is the Sensor Class?

A

You can use this class to create an instance of a specific sensor. This class provides various methods that let you determine a sensor’s capabilities.

36
Q

What is the SensorEvent Class?

A

The system uses this class to create a sensor event object, which provides information about a sensor event. A sensor event object includes the following information: the raw sensor data, the type of sensor that generated the event, the accuracy of the data, and the timestamp for the event.

37
Q

What is the Sensor Event Listener?

A

You can use this interface to create two callback methods that receive notifications (sensor events) when sensor values change or when sensor accuracy changes.

38
Q

What does the below code snippet achieve:

private SensorManager mSensorManager;

mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);

A

To identify a sensor, we first need to get a reference to the sensor service. We create an instance of the SensorManager class by calling the getSystemService() method and passing the SENSOR_SERVICE argument.

39
Q

What does the below code snippet achieve:

List deviceSensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);

A

Gets a list of all sensors on a device calling the getSensorList() method and using the TYPE_ALL constant.
We can use another constant to list all the sensors on the device such as TYPE_GYROSCOPE, TYPE_LINEAR_ACCELERATION or TYPE_GRAVITY.

40
Q

How would one determine if a given sensor i.e. light? exists on a device?

A

GetDefaultSensor(SENSOR.TYPE_LIGHT);

41
Q

Name two SensorEventListener CallBack Methods?

A

onAccuracyChanged() (low/med/high/unreliable)
onSensorChanged()
When calling a sensor, a SensorEventListener is registered, if the accuracy changes, the listener will be informed. To conserve battery it is registered onResume() and Unregistered onStop().

42
Q

What are possible options for data storage in an android application?

A
Shared Preferences - Stored as key value pairs
Internal Storage of local device
External Storage device, i.e. men-card
SQLite Database
Network Remote Connection
43
Q

What is the FileInputStream Class used for?

A

Reading Streams of Raw Bytes from a File

44
Q

What method is called to read a file from the FileInputStream Class?

A

openFileInput(fileName);

45
Q

What is the FileOutputStream Class used for?

A

Writing Streams of Raw Bytes from a File

46
Q

In order to Write the data to a file, one calls what method from the FileOutputStream Class?

A

openFileOutput(fileName, MODE-WORLD_READABLE)

47
Q

What is SQLite?

A

An open source database; SQLite supports standard relational database features SQL syntax and statements. Database requires very little memory at runTime. Embedded in Android

48
Q

Where would one find all necessary Database Classes

A

android.database package

49
Q

Where would one find all necessary SQLite Classes

A

android.database.sqlite package

50
Q

Which base class has methods to create, delete and execute SQL commands as well as other database management functionality i.e. query(), rawQuery()…

A
SQLiteOpenHelper Class 
This class is responsible for reading the database.
51
Q

What is a DAO (Data Access Object)?

A

DAO’s manage data for android applications; responsible for handling the database connection and for accessing/modifying the data. DAO’s will also convert database objects into real Java Objects so that our user interface code does not have to deal with the persistent layer.

52
Q

What function does the onUpdate() perform within the SQLite Helper Class?

A

Deletes all existing data and recreates the table.

53
Q

What is the function of the comment Class?

A

This class contains the data that users will ‘save’ in the database and show in the UI

54
Q

What permissions are needed for Google Maps API in Android?

A
Access Network State
Internet
Write External Storage
Access Coarse Location
Access Fine Location
55
Q

What XML property is the Google Maps API stored in?

A

Fragment

56
Q

What is a FRAGMENT?

A

A Behaviour/portion of the UI. Allows the user to modify the activity’s appearance at runtime whilst preserving changes made by the activity.