Android fundamentals & components
The building blocks of every interview: the four components, Activity/Fragment lifecycle, Context, tasks and the threading model.
โฌโฌโฌโฌโฌ
1. The four app components & intents
androidtheory
2. Activity lifecycle & configuration changes
androidtheory
3. Fragment lifecycle & management
androidtheory
4. Context, tasks, back stack & launch modes
androidtheory
5. Main thread, ANR, processes & threads
androidperformance
๐ฏ Stage assignment
Stage project โ "the lifecycle lab" (2-3 hours).
Build a small app with one Activity + two Fragments and log every lifecycle callback:
- Run 6 scenarios: launch, home, return, rotation, fragment navigation + back, and process death via "Don't keep activities".
- Predict the callback order for each scenario before running it, then compare against logcat and note the differences.
- Try preserving an
EditText's text three ways: a plain field, a ViewModel, andSavedStateHandle. Tabulate which survives which scenario. - Bonus: block the main thread to trigger an ANR, then catch the violation with StrictMode.
Done when: the 3-row table (field / ViewModel / SavedStateHandle ร rotation / process death) is filled in โ it is the ready answer to the most frequent interview question.