Android Flashcards
What are the four types of app components?
Activities
Services
Broadcast Receivers
Content Providers
What is an activity?
An activity is the entry point for interacting with the use. It represents a single screen with a user interface.
An activity is ___________ as a _________ of the ____________ class.
An activity is implemented as a subclass of the Activity class.
What is a content provider?
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
What is a service?
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
A service is ____________ as a subclass of ________________
A service is implemented as a subclass of Service.
What is a broadcast receiver?
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.
a broadcast receiver is implemented a subclass of ______________ and each broadcast is delivered as an _____ object.
A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object.
Activities, services, and broadcast receivers are activated by an asynchronous message called an ___________
Intent
What are Intents?
Intents are messengers that request an action from other components, whether the component belongs to your app or another.
What are the two types of intents?
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.
Content providers are activated when targeted by a request from a __________________.
ContentResolver
What are the methods to start an activity or give it something new to do?
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 can you initiate a broadcast?
You can initiate a broadcast by passing an Intent to methods such as sendBroadcast(), sendOrderedBroadcast(), or sendStickyBroadcast().
(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….
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).