{"id":19326922,"url":"https://github.com/justprodev/android-sharedprefs-codegen","last_synced_at":"2026-05-05T01:42:22.293Z","repository":{"id":45260548,"uuid":"441528505","full_name":"justprodev/android-sharedprefs-codegen","owner":"justprodev","description":"A clean way to access the Android app shared preferences","archived":false,"fork":false,"pushed_at":"2021-12-27T04:34:38.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T07:13:01.177Z","etag":null,"topics":["android","android-app","android-application","android-library","android-studio","sharedpreferences"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/justprodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-24T18:07:17.000Z","updated_at":"2021-12-27T04:34:05.000Z","dependencies_parsed_at":"2022-08-30T08:40:10.012Z","dependency_job_id":null,"html_url":"https://github.com/justprodev/android-sharedprefs-codegen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justprodev%2Fandroid-sharedprefs-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justprodev%2Fandroid-sharedprefs-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justprodev%2Fandroid-sharedprefs-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justprodev%2Fandroid-sharedprefs-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justprodev","download_url":"https://codeload.github.com/justprodev/android-sharedprefs-codegen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240427768,"owners_count":19799559,"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","android-app","android-application","android-library","android-studio","sharedpreferences"],"created_at":"2024-11-10T02:15:21.412Z","updated_at":"2026-05-05T01:42:17.262Z","avatar_url":"https://github.com/justprodev.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A clean way to access the shared preferences\n\n**Using**\n\nCreate the interface\n\n```kotlin\n@SharedPreferences\ninterface ExamplePreferences {\n    @Default(\"3\")\n    var intField: Int?\n    var stringField: String?\n    var floatField: Float?\n    var booleanField: Boolean?\n    @Default(\"123\")\n    var floatField2: Float?\n    @Default(\"true\")\n    var booleanField2: Boolean?\n}\n```\n\n- You can access generated class like \"ExamplePreferencesImpl(context)\" just after build.\n- You can use String/Int/Float/Boolean fields.\n- By default, all fields should be nullable. (@Default fields can be non-nullable)\n- To remove a value from shared preferences: \"field=null\" (Exception: @Default fields can be non-nullable)\n- To define default value, use Default field annotation\n- A preference will be named as your interface (\"ExamplePreferences\"), and sharedpreferences fields will be named as interface fields\n\n**Install**\n\n1. Add `kspVersion=1.6.10-1.0.2` (or other version corresponds to your kotlin's version) to `gradle.properties`\n2. Add to `build.gradle` in a module (like `app` or other):\n\n```\nplugins {\n    id 'com.google.devtools.ksp' version \"$kspVersion\"\n    // other plugins\n}\n\ndependencies {\n    implementation 'com.github.justprodev:android-sharedprefs-codegen:1.0'\n    ksp 'com.github.justprodev:android-sharedprefs-codegen:1.0'\n    testImplementation 'com.github.justprodev:android-sharedprefs-codegen:1.0'\n    // other dependencies\n}\n```\n\n*You should have `maven { url 'https://jitpack.io' }` in your repositories list\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustprodev%2Fandroid-sharedprefs-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustprodev%2Fandroid-sharedprefs-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustprodev%2Fandroid-sharedprefs-codegen/lists"}