{"id":24072499,"url":"https://github.com/whitedg/easysp","last_synced_at":"2025-07-14T23:08:04.222Z","repository":{"id":180884175,"uuid":"83559700","full_name":"WhiteDG/EasySP","owner":"WhiteDG","description":"🔧 A SharedPreferences wrapper that has a fluent interface to store data","archived":false,"fork":false,"pushed_at":"2023-11-29T09:56:52.000Z","size":132,"stargazers_count":74,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-28T14:54:59.777Z","etag":null,"topics":["android-library","sharedpreferences","util"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhiteDG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-03-01T13:52:12.000Z","updated_at":"2024-02-11T13:22:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"f97e74a7-e46e-43b0-acfe-30d7cc568e1d","html_url":"https://github.com/WhiteDG/EasySP","commit_stats":null,"previous_names":["whitedg/easysp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WhiteDG/EasySP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiteDG%2FEasySP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiteDG%2FEasySP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiteDG%2FEasySP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiteDG%2FEasySP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhiteDG","download_url":"https://codeload.github.com/WhiteDG/EasySP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiteDG%2FEasySP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365678,"owners_count":23753378,"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","sharedpreferences","util"],"created_at":"2025-01-09T17:17:51.769Z","updated_at":"2025-07-14T23:08:04.202Z","avatar_url":"https://github.com/WhiteDG.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasySP\n[中文版点我](https://github.com/WhiteDG/EasySP/blob/master/README_ZH.md)\n\nEasySP is a lightweight utility for handling SharedPreferences on Android. It simplifies SharedPreferences data operations, offering support for chain calls, enabling you to write multiple data entries with just one line of code.\n\n## Installation\n\nAdd the depedency in your build.gradle. The library is distributed via jCenter.\n```\ndependencies {\n    implementation 'com.white:easysp:1.0.0'\n}\n```\n## Usage\n\n- Save data to `sharedpreferences.xml`   \n```\nEasySP.init(context).putBoolean(\"boolean\", true);\n\n// you can also use a string resource value as the key\nEasySP.init(context).putBoolean(R.string.key_bool, true);\n\n// or specify a custom name for the preferences' name:\nEasySP.init(context,\"Custom\").putBoolean(\"boolean\", true);\n```\n\n- Save multiple data with one line of code\n```\nEasySP.init(context)\n                .putBoolean(R.string.key_bool, true)\n                .putInt(R.string.key_int, 1)\n                .putString(R.string.key_string, \"string\")\n                .putLong(R.string.key_long, 1000000000)\n                .putFloat(R.string.key_float, 1.1f)\n                .put(\"put\", 100)\n                .putStringSet(R.string.key_set, strings);\n```\n\n- Read data\n```\nboolean booleanData = EasySP.init(context).getBoolean(\"bool\");\n\nboolean booleanData = EasySP.init(context).getBoolean(R.string.key_bool,defValue);\n```\n\n- Remove data\n```\nEasySP.init(context).remove(\"bool\");\n\nEasySP.init(context).remove(R.string.key_bool);\n```\n- Clear data\n```\nEasySP.init(context).clear();\n```\n\n## License\n\n[MIT License](https://github.com/WhiteDG/EasySP/blob/master/LICENSE) @[Wh1te](https://github.com/WhiteDG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitedg%2Feasysp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitedg%2Feasysp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitedg%2Feasysp/lists"}