Lecture 12: Intro to Services Flashcards
A service is launched from the __ as the __ that called it
- same thread
- host
Can services run in parallel?
No
Services have a lifetime that may be controlled by the ___ or __
- service itself
- outside forces
What are the 2 broad categories services can be split into based on their user visibility
- foreground services
- background services
A __ service doesnt require user UI interaction, but does require that a notification be shown to let the user know the serivce is running
foreground
A __ service a a hidden service. Not required to provide a notification or provide any indication that its running
background
__ services are good for silently updating or managing aspects of your app without requiring user interaction
background
What are some of the limitations you may do with background services since they provide no indication that theyre running
- Give them a allowance of time to access sensitive info since the last user noticeable action
- May be restricted from using certain components
When are bound services essential?
When a service must be able to pass data off to other activities or services in real time rather than editing data on disk for others to read
A __ service creates a communication link between itself and one or more binders that allows for data transfer back and forth
bound
What 3 things do you need to create a service?
- An entry in the app manifest file declaring the service with a name and other descriptors
- A java class that extends the standard service class for android and implements the 4 lifecycle functions required
- An intent used to launch the service
Services must be declared within your app manifest within a __ tag and the only required field is the ___
- <service>
</service> - name of the service
Each service is defined it its own __ which ___ from the default Android ___ class
- class
- extends
- service
Within the service class we must __ a set of __ for the service
- override
- lifecycle functions
Describe the service lifecycle
- Begins with onCreate() and ends with onDestroy()