Skip to content

myofficework000/DataStoreDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataStore Demo

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.

Features

  • 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]

Overview

DataStoreDemo showcases two types of DataStore:

  1. Preferences DataStore: Simple key-value storage for primitive data types.
  2. Proto DataStore: Structured data storage using Protocol Buffers for complex data objects.

Features

  • 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.

Setup

To get started:

  1. 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).

Usage

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" }

Technologies Used

Contributing

Contributions are welcome! Feel free to submit a pull request with your improvements.

About

Demo app to utilises dataStore using jetpack compose and clean code architecture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages