Android Flashcards

1
Q

What are the four types of app components?

A

Activities
Services
Broadcast Receivers
Content Providers

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

What is an activity?

A

An activity is the entry point for interacting with the use. It represents a single screen with a user interface.

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

An activity is ___________ as a _________ of the ____________ class.

A

An activity is implemented as a subclass of the Activity class.

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

What is a content provider?

A

The interface to data saved in a structured format. A content provider manages a shared set of app data that you can store in the file system

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

What is a service?

A

A general purpose entry point for keeping an app running in the background for all kinds of reasons. It does not provide a user interface

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

A service is ____________ as a subclass of ________________

A

A service is implemented as a subclass of Service.

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

What is a broadcast receiver?

A

A broadcast receiver is a component that enables the system to deliver events to the app outside of a regular user flow, allowing the app to respond to system-wide broadcast announcements.

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

a broadcast receiver is implemented a subclass of ______________ and each broadcast is delivered as an _____ object.

A

A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object.

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

Activities, services, and broadcast receivers are activated by an asynchronous message called an ___________

A

Intent

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

What are Intents?

A

Intents are messengers that request an action from other components, whether the component belongs to your app or another.

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

What are the two types of intents?

A

Explicit & implicit intents. Explicit intent defines a message to activate a specific component. Implicit intent defines a message to activate a specific type of components.

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

Content providers are activated when targeted by a request from a __________________.

A

ContentResolver

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

What are the methods to start an activity or give it something new to do?

A

You can start an activity or give it something new to do by passing an Intent to startActivity() or startActivityForResult() (when you want the activity to return a result).

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

How can you initiate a broadcast?

A

You can initiate a broadcast by passing an Intent to methods such as sendBroadcast(), sendOrderedBroadcast(), or sendStickyBroadcast().

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

(API 21+) The JobScheduler can be used to schedule actions. Previously you can start a service (or give new instructions to an ongoing service) by….

A

passing an Intent to startService(). You can bind to the service by passing an Intent to bindService(). (Must use Explicit Intent and do no declare intent filters for your services).

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

You can perform a query to a content provider by calling ________ on a ______________

A

by calling query() on a ContentResolver.

17
Q

The primary task of the manifest is …..

A

The primary task of the manifest is to inform the system about the app’s components.

18
Q

The manifest does a number of things in addition to declaring the app’s components, such as the following four:

A

1) User permissions,
2) Minimum API, 3) hardware/software features used/required,
4) API libraries (e.g. Google Maps libary).

19
Q

What series of callbacks are used to handle transitions between states of an activity lifecycle?

A
onCreate()
onStart()
       onResume()
onPause()
        onStop()
onRestart() or onDestroy()
20
Q

Most of an app’s core functionality is implemented in the __________ method.

A

onResume()

21
Q

What callbacks follow onPause() ?

A

onStop() or onResume()

22
Q

What callbacks follow onStop()?

A

onRestart() or onDestroy()

23
Q

During what callbacks is an activity visible to the user?

A

onStart()
onResume()
onPause() partially visible