{"id":20935639,"url":"https://github.com/nameisjayant/jetpack-datastore-library-example","last_synced_at":"2025-06-15T01:32:11.060Z","repository":{"id":121642545,"uuid":"294998546","full_name":"nameisjayant/Jetpack-DataStore-library-Example","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-12T18:06:53.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T02:42:43.217Z","etag":null,"topics":["coroutines","datastore","flow","kotlin","livedata"],"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-12T18:02:09.000Z","updated_at":"2022-04-08T22:31:47.000Z","dependencies_parsed_at":"2024-08-11T14:30:25.112Z","dependency_job_id":null,"html_url":"https://github.com/nameisjayant/Jetpack-DataStore-library-Example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nameisjayant/Jetpack-DataStore-library-Example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-library-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-library-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-library-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-library-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nameisjayant","download_url":"https://codeload.github.com/nameisjayant/Jetpack-DataStore-library-Example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nameisjayant%2FJetpack-DataStore-library-Example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259908572,"owners_count":22930433,"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":["coroutines","datastore","flow","kotlin","livedata"],"created_at":"2024-11-18T22:15:53.463Z","updated_at":"2025-06-15T01:32:11.032Z","avatar_url":"https://github.com/nameisjayant.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jetpack-DataStore-library-Example\n\nWhat is DataStore 🤷‍♀️?\nJetpack DataStore is a data storage solution.\nIt allows us to store key-value pairs (like SharedPreferences) or typed objects with protocol buffers\nDataStore uses Kotlin, Coroutines and Flow to store data asynchronously with consistency and transaction support 😍.\nIn short, it’s the new data storage solution which is the replacement of SharedPreferences.\n\n\nWhy DataStore 🤷‍♂️\nFirst and my favourite reason 😃 — Built with❤️ Kotlin, Coroutines and Flow.\nIf you have used SharedPreferences you might abuse or blamed it for something 😆 then DataStore is here to rescue!\nSharedPreference 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👀.\nIt’s safe from runtime exceptions!❌⚠️. What would be more satisfying that? 😅\nIt also provides a way to migrate from SharedPreferences 😍.\nIt provides Type safety! (Using Protocol buffers).\nThese 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-library-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnameisjayant%2Fjetpack-datastore-library-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnameisjayant%2Fjetpack-datastore-library-example/lists"}