Skip to content

Magellan 1.x Why Magellan?

Ryan Moelter edited this page Jul 18, 2021 · 1 revision

The foundation Google wants you to use for making Android apps consists of Activitys and Fragments. Unfortunately, there are significant problems with these foundational components. Magellan is our attempt to provide a foundation for building great Android apps, without the problems associated with Activitys and Fragments.

Problems with Activity and Fragments

The best explanation of why Fragments are hard to use is probably Advocating Against Android Fragments by Pierre-Yves Ricau.

Here is a summary of the main issues:

  • Ridiculously complex lifecycle
  • Passing objects between Activitys/Fragments requires serialization
  • Handling rotation is a pain
  • Poor control of the backstack
  • Hard to test

Solution

Magellan attempts to avoid the problems with Activitys and Fragments by:

  • Reducing interaction with Activitys/Fragments by using a Single Activity Architecture
  • Creating a simple, consistent lifecycle for Screens
  • Letting Screens survive rotation, but not views
  • Using our own navigation system to avoid annoying serialization
  • Making Screens simple, easy-to-test java objects
  • Separating the logic from the views for simpler testing