{"id":20935641,"url":"https://github.com/nameisjayant/jetpack-datastore-prefernce-example-2-android-kotlin","last_synced_at":"2026-05-16T11:04:10.832Z","repository":{"id":121642603,"uuid":"295297274","full_name":"nameisjayant/Jetpack-DataStore-Prefernce-Example-2-Android-kotlin","owner":"nameisjayant","description":"What is DataStore 🤷‍♀️? Jetpack DataStore is a data storage solution. It allows us to store key-value pairs (like SharedPreferences) or typed objects with protocol buffers DataStore uses Kotlin, Coroutines and Flow to store data asynchronously with consistency and transaction support 😍. In short, it’s the new data storage solution which is the replacement of SharedPreferences.","archived":false,"fork":false,"pushed_at":"2020-09-14T03:51:01.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T19:58:19.965Z","etag":null,"topics":["android","datastore","jetpack","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nameisjayant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-14T03:48:48.000Z","updated_at":"2022-02-05T18:49:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef8fdab7-549d-4760-8ce3-d53470727840","html_url":"https://github.com/nameisjayant/Jetpack-DataStore-Prefernce-Example-2-Android-kotlin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-Prefernce-Example-2-Android-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-Prefernce-Example-2-Android-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-Prefernce-Example-2-Android-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-Prefernce-Example-2-Android-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nameisjayant","download_url":"https://codeload.github.com/nameisjayant/Jetpack-DataStore-Prefernce-Example-2-Android-kotlin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330259,"owners_count":20274037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","datastore","jetpack","kotlin"],"created_at":"2024-11-18T22:15:53.751Z","updated_at":"2025-10-13T17:38:50.442Z","avatar_url":"https://github.com/nameisjayant.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jetpack-DataStore-Prefernce-Example-2-Android-kotlin\n\nWhat is DataStore 🤷‍♀️? Jetpack DataStore is a data storage solution. It allows us to store key-value pairs (like SharedPreferences) or typed objects with protocol buffers DataStore uses Kotlin, Coroutines and Flow to store data asynchronously with consistency and transaction support 😍. In short, it’s the new data storage solution which is the replacement of SharedPreferences.\n\nWhy DataStore 🤷‍♂️ First and my favourite reason 😃 — Built with❤️ Kotlin, Coroutines and Flow. If you have used SharedPreferences you might abuse or blamed it for something 😆 then DataStore is here to rescue! SharedPreference has some drawbacks like it provided synchronous APIs -but it’s not MAIN-thread-safe! whereas DataStore is safe to use in UI thread because it uses Dispatchers.IO under the hood👀. It’s safe from runtime exceptions!❌⚠️. What would be more satisfying that? 😅 It also provides a way to migrate from SharedPreferences 😍. It provides Type safety! (Using Protocol buffers). These are some reasons which encourage us to use DataStore and finally say goodbye to beloved SharedPreferences 👋.\n\nLet’s begin code 👨‍💻\n\nWe’ll develop a sample Android application which stores a UI mode preference from user i.e. 🌞 Light Mode or 🌑 Dark Mode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnameisjayant%2Fjetpack-datastore-prefernce-example-2-android-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnameisjayant%2Fjetpack-datastore-prefernce-example-2-android-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnameisjayant%2Fjetpack-datastore-prefernce-example-2-android-kotlin/lists"}