Enhancing User Experience: Reducing ANR Rates with DataStore in Skeelo Android App
Article Summary
Skeelo's Android app was freezing on users. The culprit? SharedPreferences blocking the main thread and triggering ANR errors.
The Skeelo engineering team migrated from SharedPreferences to Jetpack DataStore to eliminate Application Not Responding (ANR) errors. They took a phased approach, prioritizing the most critical functions causing crashes using Firebase Crashlytics and Sentry data.
Key Takeaways
- SharedPreferences performs blocking I/O on main thread, causing 5+ second freezes
- DataStore uses Kotlin coroutines and Flow for non-blocking async operations
- Phased migration prioritized high-impact functions using crash analytics data
- Significant ANR reduction achieved with smoother, more responsive user experience
Critical Insight
Migrating from SharedPreferences to DataStore dramatically reduced ANR rates and improved app stability through asynchronous, non-blocking data operations.