An Introduction to Android

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

Mindmap

Android’s building blocks: Activity, Service, BroadcastReceiver, ContentProvider

  • Activity
    • Activity Lifecycle
      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
  • 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

Advanced Practical Issues