Created
September 21, 2018 06:37
-
-
Save shao-wang-me/d43e451d77d8327577f6b210feb4938f to your computer and use it in GitHub Desktop.
Android Dev Notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kotlin, Java, C++ | |
1. App components (entry points of app): | |
- Activity | |
- Service | |
- Broadcast receiver | |
- Content Provider | |
2. Activity (UI) | |
- Represents a single screen | |
- One app can have multiple activities, each is an different interface | |
- Other apps can start any activities if allowed | |
- "Activity" class | |
3. Service | |
- No interface, run in background for long-running operations | |
- Can bind with Activity (or processes) | |
- Lower chance being killed if bound to an important process | |
- Two types (based on user awareness): | |
- User aware (e.g. Music): foregroud with a notification | |
- Not user aware (e.g. GDrive sync): higher chance being killed by the system | |
- "Service" class | |
4. Broadcast receiver | |
- Receive events outside a regular user flow | |
- Even when the app is not running | |
- System broadcasts, app broadcasts | |
- Can create a status bar notification | |
- Can be just a gateway to other components to do a small amount of work | |
- "BroadcastReceiver" class, broadcasts are just "Intent"s | |
5. Content provider | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment