Modernising a Legacy Android App Architecture: Part One - Single Activity
Article Summary
Rob Pridham from BBC Sport reveals how they modernized a 7-year-old Android codebase without a full rewrite. The secret? A strategic refactor that tackled navigation chaos first.
BBC Sport's Android app, built in 2013, had accumulated significant tech debt with multiple activities creating navigation complexity and duplicated responsibilities. Rather than starting from scratch, the team executed a focused refactor to align with modern Android practices while maintaining product consistency.
Key Takeaways
- Replaced multiple activities with single activity architecture using fragment hierarchy
- Created clear responsibility layers: splash OR disabled OR enabled content
- Eliminated navigation soup where any activity could be entry point
- Positioned codebase for future Jetpack Navigation adoption without taking on excessive risk
BBC Sport transformed their legacy Android app's navigation from a complex multi-activity maze into a clean, single-activity hierarchy with properly scoped responsibilities.
About This Article
BBC Sport's Android codebase started in 2013 with a mix of MVP, MVVM, and MVI architectures. This inconsistency made it hard for developers to figure out the standard way to build features.
Rob Pridham's team built a hierarchical fragment system where MainFragment handles the bootstrap state, AppEnabledFragment manages sign-in logic, and content sits in layers below. This removed the need for multiple activity entry points.
The refactor prepared the codebase for Jetpack Navigation down the road and reduced technical risk by tackling one architectural change at a time instead of attempting a full rewrite like BBC Sounds did.