{"id":21385910,"url":"https://github.com/islamdidarmd/kpref","last_synced_at":"2025-03-16T12:13:44.586Z","repository":{"id":107626192,"uuid":"177375466","full_name":"islamdidarmd/Kpref","owner":"islamdidarmd","description":"A class that saves time of writing boilerplate code for saving any kind of data in shared preferences","archived":false,"fork":false,"pushed_at":"2019-10-30T05:11:18.000Z","size":135,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T23:44:12.117Z","etag":null,"topics":["android","java","kotlin","kpref","preference","shared"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/islamdidarmd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","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":"2019-03-24T05:40:48.000Z","updated_at":"2019-10-30T05:10:30.000Z","dependencies_parsed_at":"2023-06-08T15:30:19.310Z","dependency_job_id":null,"html_url":"https://github.com/islamdidarmd/Kpref","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamdidarmd%2FKpref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamdidarmd%2FKpref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamdidarmd%2FKpref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamdidarmd%2FKpref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islamdidarmd","download_url":"https://codeload.github.com/islamdidarmd/Kpref/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864821,"owners_count":20360360,"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","java","kotlin","kpref","preference","shared"],"created_at":"2024-11-22T11:51:39.460Z","updated_at":"2025-03-16T12:13:44.557Z","avatar_url":"https://github.com/islamdidarmd.png","language":"Kotlin","readme":"# Kpref\nA class that saves time of writing boilerplate code for saving any kind of data in shared preferences\n\n[![](https://jitpack.io/v/islamdidarmd/Kpref.svg)](https://jitpack.io/#islamdidarmd/Kpref)\n\n## Installation (with Gradle)\nStep 1. Add the JitPack repository to your build file\n\nAdd it in your root build.gradle at the end of repositories:\n```groovy\n   allprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\nStep 2. Add the dependency\n\n```groovy\ndependencies {\n\t\timplementation 'com.github.islamdidarmd:Kpref:0.1.1'\n\t}\n```\n\t\n### How to use\n\n```kotlin\n                //save values in a default sharedPreference\n                Kprefs.initDefault(this)\n\n                Kprefs.save(\"test\", 10)\n\n                val x: Int? = Kprefs.get(\"\")\n\n\n                //save values in your preference\n                val pref = getSharedPreferences(\"my_preference\", Context.MODE_PRIVATE)\n                Kprefs.init(pref)\n\n                Kprefs.save(\"testMyPref\", \"Saved\")\n\n                val value: String? = Kprefs.get(\"\")\n```\n\n\nYou must call `Kprefs.initDefault(this)` or `Kprefs.init(pref)` before calling any methods\nFor a complete example, see the sample app\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislamdidarmd%2Fkpref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislamdidarmd%2Fkpref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislamdidarmd%2Fkpref/lists"}