Content Providers & Broadcasts
ANDROID › Components
Sharing data across app boundaries and reacting to system or app-wide broadcast events.
Interviewers use this topic to probe your grasp of Android's IPC primitives: when a ContentProvider is genuinely warranted versus simpler storage, and how BroadcastReceivers behave under modern restrictions. Expect questions on content URIs, ContentResolver CRUD, ordered broadcasts, the Android 8 implicit-broadcast clampdown, and the Android 13+ exported-flag requirement. Getting the security and lifecycle details right separates seniors from juniors.
What this covers
- When a ContentProvider is justified (sharing data across apps, search suggestions, widgets, sync adapters) vs. simpler alternatives like Room or DataStore
- Content URI anatomy (content://authority/path/id) and ContentResolver query/insert/update/delete returning Cursor/Uri/Int
- Manifest-declared vs. context-registered receivers, their lifecycles, and when each is appropriate
- Ordered broadcasts: priority ordering, result propagation, and abortBroadcast()
- Implicit-broadcast restrictions since Android 8 (API 26) and the RECEIVER_EXPORTED/RECEIVER_NOT_EXPORTED requirement on Android 13+
- Receiver constraints: onReceive runs on the main thread, must return fast, goAsync() gives ~10s, and you can't start activities or long work directly
Study this topic
- Content Providers & Broadcasts explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Content Providers & Broadcasts interview questions and answers