Android DataStore Preferences
Implements standardized Jetpack DataStore patterns for robust on-device state management in Android projects.
This skill provides specialized guidance for implementing Jetpack DataStore, the modern replacement for SharedPreferences in Android development. It covers both Preferences DataStore for simple key-value pairs and Proto DataStore for structured, type-safe data. The skill ensures best practices are followed, including Hilt dependency injection, repository-pattern wrapping to prevent UI-layer leakage, safe migration strategies from legacy SharedPreferences, and critical configurations for multi-process safety and unit testing.
主要功能
01Standardized Hilt dependency injection for singleton instances
02Step-by-step SharedPreferences migration workflows
03Multi-process safety configurations and testing strategies
04Implementation patterns for both Preferences and Proto DataStore variants
05Repository-layer wrapping with reactive Flow error handling
060 GitHub stars
使用场景
01Implementing type-safe user settings and onboarding states
02Migrating a legacy Android app from SharedPreferences to Jetpack DataStore
03Managing persistent data across multiple application processes or widgets