โ—† Sparround

Android fundamentals & components

0%

The building blocks of every interview: the four components, Activity/Fragment lifecycle, Context, tasks and the threading model.

๐ŸŽฏ 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, and SavedStateHandle. 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.