Nowadays Android is among the most widely used systems in the world. This blog serves as a note for knowledge points on how Android app components work together.
- Android’s building blocks
- Practical Issues
- Advanced Practical Issues
Android’s building blocks: Activity, Service, BroadcastReceiver, ContentProvider
- Activity
- Activity Lifecycle
A few methods are called in sequence during some operations:- Initial start: onCreate() -> onStart() -> onResume()
- Pause then resume: onPause() -> onResume()
- Stop then resume: onPause() -> onStop() -> onStart() -> onResume()
- Intent:
Intent activates three of the four basic building blocks: Activity, Service, and BroadcastReceiver.- Explicit Intent
- Implicit Intent and app selector
- Intent can convey information. Types of information it can carry over between Activities and Fragments, etc.
- Fragment
- Fragment’s lifecycle
- Fragment should live on Activity
- Activity Lifecycle
- Service
- Long-running class. What’s different between a Service and an AsyncTask is that an AsyncTask can run on UI thread and is relatively short, while a Service has no frontend, no UI components, and is relatively long-running.
- BroadcastReceiver
- Class that receives Intents sent by createBroadcast()
- ContentProvider
Practical Issues
- Creating and customizing a Toast
- Internetworking in Android
- Displaying Lists
- ListView
- RecycleView (new in Android 5)
- Swiping between pages
- Swiping effects, and its animation
- ViewPager
- Storing Information
- Store in disk: internal / external storage. Remember to get permission before that.
- SharedPreferences
- Store to database
- Store to server
- Displaying graphics
- Canvas, Paint, etc.
- Customizing View Classes. How onDraw() and onLayout() are passed within the view hierarchy.
Advanced Practical Issues
- Resource Packaging
- Architecture
- MVC, MVP, MVVM
- Evolution of Android architecture
- Optimization
- NDK