This project is a demonstration of implementing Android Jetpack's DataStore for data management within a Jetpack Compose app. It follows a clean code architecture, providing a foundation for utilizing DataStore in real-world applications.
- Display a list of task
- Sort the task by Priority
- Sort the task by Deadline
- Change the app theme
- Show compelted and pending tasks
- delete task [Upcoming]
- delete all task [upcoming]
DataStoreDemo showcases two types of DataStore:
- Preferences DataStore: Simple key-value storage for primitive data types.
- Proto DataStore: Structured data storage using Protocol Buffers for complex data objects.
- Jetpack Compose UI: Modern, declarative UI for Android.
- DataStore Implementation: Demonstrates both Preferences and Proto DataStores.
- Clean Architecture: Separates concerns into different layers for maintainability.
- Coroutines and Flow: Manages asynchronous data operations.
To get started:
- Clone the repository:
git clone https://github.com/myofficework000/DataStoreDemo.git
Open the project in Android Studio and sync Gradle. Ensure your Android SDK is up-to-date (API level 21 or higher).
This app demonstrates reading and writing data in a reactive way:
Preferences DataStore: Stores simple user settings. Proto DataStore: Stores structured data with custom fields. Example usage for storing preferences data:
dataStore.edit { preferences -> preferences[PreferencesKeys.EXAMPLE_KEY] = "example_value" }
Kotlin for programming language. Jetpack Compose for UI. DataStore (Preferences and Proto) for data storage. Coroutines and Flow for async programming.
Contributions are welcome! Feel free to submit a pull request with your improvements.