Lecture 2: Major Components of Android Apps Flashcards
What are the 3 major categories that the content of an APK package can be split into?
- Code: .dex files, .so files
- Resources: images, fonts, resource list, etc
- Other files: app manifest, metadata
What are the 4 classes of components of an android application?
- Activities: UI and human-computer interfacing
- Services: Background app processes
- Broadcast Receivers: System notifications
- Content Providers: Reading and writing data
Can a app only have a single activitity or multiple activities?
Multiple activities withi their own GUI layout, inputs, and outputs
True or false?
Activites owned by an app can only be called within that app
False
Activities owned by an app may be called from other applications as well
Besides handling UI layout and sharing of application functionality, Activities also server __?
Store user state
What is the purpose of the services component?
To handle the background functionality of applications
Services do not provide UI but allow __
code to be executed without interrupting other activities
What are the different priority levels for a service?
Services the user is aware of:
- Higher priority
Services the user isn’t aware of:
- Lower priority
- Can be put off
Like activites services may also be called by ___, this becomes known as a ___ service
- other applications
- bound service
What do bound services allow android to do?
Ensure a service stays running as long as the calling app is also running
What is the purpose of the broadcast receiver?
To allow an application to receive data and ‘wake up’ without the need for a constantly running background service listener
What types of components work in the background and have no UI element or screen
- Services
- Broadcast Receivers
Which component can generate system notifications or tell applications to generate system notifications?
Broadcast Receivers
What components is more preferable to use over a service and why?
Broadcast Receivers
They have less overhead in terms of resources used
What is the purpose of the content provider?
Handle programmatic data access by other applications.
Gives you a way to share data between apps in a controlled and secure manner