Modern Android: How to ditch Activities and Fragments
summary
Claim: adopt a single Activity architecture and use Magellan so screens are plain Java objects, screens survive rotation while views are recreated, and navigation is a stack-driven navigator so you literally call goTo(screen). Implementation details: constructor-based screens, view-swapping container, dialog recreation, an Rx plugin for auto-unsubscribe, testing benefits, and a production 1.0 used for ~1.5 years with claimed productivity parity with iOS teams. Trade-offs: some SDK fragments (maps) need adapters, process-kill still restarts app, and activity-result plumbing is left to implement.
AI-written summary · about
chapters (18)
- 0:00Start
- 1:42Android Lifecycle
- 3:20Full Activity Lifecycle
- 5:34The Problems with the Activities and Fragments
- 7:09Single Activity Architecture
- 9:58Architecture
- 11:22Model View Presenter
- 12:50Why Separate the Logic from the Views
- 13:52Test Your Business Logic
- 22:27Headless Fragment
- 27:05Auto Unsubscribe
- 31:55How Will You Manage the Runtime Permissions
- 32:57How Do You Manage Dialogue
- 33:19Show Dialogue
- 34:41Dialogue Fragment
- 36:26Data Loading
- 39:36State Saving
- 42:32Productivity
related talks
37mSingle Activity by Example
39mSingle activity: Why, when, and how
36mNavigation and the Single Activity: Learnings from a Skeptic
06m10 best practices for moving to a single activity
38mMigrating to a Single-Activity Architecture in a Modular App
26mSingle activity navigation so simple even I can understand it
42mRoad to Single Activity
46mAndroid Jetpack: How to smartly use fragments in your UI
