{"id":17472364,"url":"https://github.com/pranavpandey/dynamic-preferences","last_synced_at":"2025-04-22T10:21:08.732Z","repository":{"id":41167256,"uuid":"214564998","full_name":"pranavpandey/dynamic-preferences","owner":"pranavpandey","description":"Manage shared preferences on Android.","archived":false,"fork":false,"pushed_at":"2023-12-07T14:31:12.000Z","size":1001,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T05:42:56.381Z","etag":null,"topics":["android","library","manage","preferences","shared"],"latest_commit_sha":null,"homepage":"https://dynamic.pranavpandey.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pranavpandey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"pranavpandey","patreon":"pranavpandey","open_collective":"pranavpandeydev","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["paypal.me/pranavpandeydev"]}},"created_at":"2019-10-12T02:41:39.000Z","updated_at":"2023-12-22T03:02:51.000Z","dependencies_parsed_at":"2023-12-10T14:47:39.624Z","dependency_job_id":null,"html_url":"https://github.com/pranavpandey/dynamic-preferences","commit_stats":{"total_commits":66,"total_committers":1,"mean_commits":66.0,"dds":0.0,"last_synced_commit":"b9a8f76a35eff6e4452726e39fac33763a58cda5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavpandey%2Fdynamic-preferences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavpandey%2Fdynamic-preferences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavpandey%2Fdynamic-preferences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavpandey%2Fdynamic-preferences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pranavpandey","download_url":"https://codeload.github.com/pranavpandey/dynamic-preferences/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238394549,"owners_count":19464617,"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","library","manage","preferences","shared"],"created_at":"2024-10-18T17:08:50.662Z","updated_at":"2025-04-22T10:21:08.722Z","avatar_url":"https://github.com/pranavpandey.png","language":"Java","funding_links":["https://github.com/sponsors/pranavpandey","https://patreon.com/pranavpandey","https://opencollective.com/pranavpandeydev","paypal.me/pranavpandeydev","https://paypal.me/pranavpandeydev"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./graphics/icon.png\" height=\"160\"\u003e\n\n# Dynamic Preferences\n\n[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?)](https://www.apache.org/licenses/LICENSE-2.0.html)\n[![Build Status](https://travis-ci.org/pranavpandey/dynamic-preferences.svg?branch=master)](https://travis-ci.org/pranavpandey/dynamic-preferences)\n[![Release](https://img.shields.io/maven-central/v/com.pranavpandey.android/dynamic-preferences)](https://search.maven.org/artifact/com.pranavpandey.android/dynamic-preferences)\n\n**A library to manage shared preferences on Android 4.0 (API 14) and above.**\n\n\u003e [!IMPORTANT]\n\u003e It uses [AndroidX][androidx] so, first [migrate][androidx-migrate] your project to AndroidX.\n\u003cbr/\u003eSince v2.1.0, it is dependent on Java 8 due to the dependency on\n[Dynamic Utils][dynamic-utils].\n\u003cbr/\u003eSince v2.3.1, it is targeting Java 17 to provide maximum compatibility.\n\u003cbr/\u003eSince v2.4.0, the minimum SDK is Android 4.4 (API 19) to comply with the latest policies.\n\n---\n\n## Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Initialize](#initialize)\n    - [Save](#save)\n    - [Load](#load)\n    - [Delete](#delete)\n    - [Dependency](#dependency)\n- [License](#license)\n\n---\n\n## Installation\n\nIt can be installed by adding the following dependency to your `build.gradle` file:\n\n```groovy\ndependencies {\n    // For AndroidX enabled projects.\n    implementation 'com.pranavpandey.android:dynamic-preferences:2.4.0'\n}\n```\n\n---\n\n## Usage\n\nIt provides various methods to `save`, `load` and `delete` keys and preferences. Please read \nbelow about the various supported operations.\n\n\u003e For a complete reference, please read the [documentation][documentation].\n\n### Initialize\n\n`DynamicPreferences` must be initialized once before accessing its methods.\n\n```java\n// Initialize with application context.\nDynamicPreferences.initializeInstance(applicationContext);\n```\n\nAfter initializing, its various public methods can be accessed via getting the initialized \ninstance.\n\n### Save\n\nIt supports the saving of `boolean`, `int`, `String` and `Set\u003cString\u003e` value types into the \nshared preferences. \n\n```java\n// Save a value in the default shared preferences.\nDynamicPreferences.getInstance().save(key, value);\n\n// Save a value in the supplied shared preferences.\nDynamicPreferences.getInstance().save(preferences, key, value);\n```\n\n### Load\n\nIt supports the retrieval of `boolean`, `int`, `String` and `Set\u003cString\u003e` value types from the \nshared preferences. \n\n```java\n// Retrieve a value from the default shared preferences.\nDynamicPreferences.getInstance().load(key, defaultValue);\n\n// Retrieve a value from the supplied shared preferences.\nDynamicPreferences.getInstance().save(preferences, key, defaultValue);\n```\n\n### Delete\n\nIt supports the deletion of a particular `key` or a complete shared preferences.\n\n```java\n// Remove a key from the default shared preferences.\nDynamicPreferences.getInstance().delete(key);\n\n// Remove a key from the supplied shared preferences.\nDynamicPreferences.getInstance().delete(preferences, key);\n\n// Delete a shared preferences.\nDynamicPreferences.getInstance().deleteSharedPreference(preferences);\n```\n\n### Dependency\n\nIt depends on the [dynamic-utils][dynamic-utils] to perform various internal operations. \nSo, its functions can also be used to perform other useful operations.\n\n---\n\n## Author\n\nPranav Pandey\n\n[![GitHub](https://img.shields.io/github/followers/pranavpandey?label=GitHub\u0026style=social)](https://github.com/pranavpandey)\n[![Follow on Twitter](https://img.shields.io/twitter/follow/pranavpandeydev?label=Follow\u0026style=social)](https://twitter.com/intent/follow?screen_name=pranavpandeydev)\n[![Donate via PayPal](https://img.shields.io/static/v1?label=Donate\u0026message=PayPal\u0026color=blue)](https://paypal.me/pranavpandeydev)\n\n---\n\n## License\n\n    Copyright 2019-2024 Pranav Pandey\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n[androidx]: https://developer.android.com/jetpack/androidx\n[androidx-migrate]: https://developer.android.com/jetpack/androidx/migrate\n[documentation]: https://pranavpandey.github.io/dynamic-preferences\n[dynamic-utils]: https://github.com/pranavpandey/dynamic-utils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavpandey%2Fdynamic-preferences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranavpandey%2Fdynamic-preferences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavpandey%2Fdynamic-preferences/lists"}