BBC Rob Pridham Dec 7, 2020

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

Critical Insight

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.

Part two reveals the UI design pattern they chose to structure these fragments and why they made controversial decisions about certain popular frameworks.

About This Article

Problem

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.

Solution

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.

Impact

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.