How we achieved a 6x reduction of ANRs - Part 2: Fixing ANRs
Article Summary
Bumble's Android team slashed their ANR (Application Not Responding) rate by 6x. Here's how they debugged one of mobile's most frustrating problems.
ANRs happen when Android's main thread blocks for too long, creating a terrible user experience. Bumble's team discovered that 60% of their ANRs occurred during app startup, triggered by push notification broadcasts.
Key Takeaways
- Cut cold app startup time by 50% through lazy initialization and background tasks
- SharedPreferences apply() can block the main thread during Activity lifecycle events
- Moving push notifications to a separate process reduced ANRs by 2x instantly
- Background app launches took 5 seconds on average, with 3% exceeding the 10 second ANR threshold
Critical Insight
By optimizing app startup, fixing SharedPreferences blocking, and isolating push handling in a separate process, Bumble reduced their ANR rate from 0.80% to 0.28%.