~/talk

10 best practices for moving to a single activity

Talkat Android Dev Summit 2018 · 2018-11-07..11-08· [android]
slides:none on file

Ten concrete moves for a single-activity app: use activities only as UI entry points, share state via activity-scoped viewmodels, and extract business logic out of fragments for unit tests. Adopt the Navigation Architecture Component plus the Safe args Gradle plugin to generate type-safe directions and avoid manual fragment transactions. Use the new Fragment testing artifact (Fragment 1.1 / FragmentScenario) and mock NavController to verify navigation, employ FragmentFactory for constructor injection, and prefer multiple tasks over many activities when appropriate.

AI-written summary · about

  1. 0:00Use Activities As Entry Points
  2. 0:25Share Data Between Screens
  3. 1:06Use the Navigation Architecture Component
  4. 1:58Navigate Between Destinations
  5. 2:36Extract Your Business Logic
  6. 3:01Test With Fragment Scenario
  7. 3:35Mock the NavController
  8. 4:15Inject Dependencies
  9. 4:32Use Multiple Tasks When Appropriate
  10. 4:50Don't Contort Your App Architecture
  11. 6:01Android Dev Summit
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.