{"id":18784472,"url":"https://github.com/pwittchen/prefser","last_synced_at":"2025-09-11T16:17:26.297Z","repository":{"id":27592683,"uuid":"31075855","full_name":"pwittchen/prefser","owner":"pwittchen","description":"Wrapper for Android SharedPreferences with object serialization and RxJava Observables","archived":false,"fork":false,"pushed_at":"2020-08-19T08:49:40.000Z","size":778,"stargazers_count":230,"open_issues_count":12,"forks_count":26,"subscribers_count":10,"default_branch":"RxJava2.x","last_synced_at":"2025-05-20T03:07:39.461Z","etag":null,"topics":["android","preferences","rxandroid","rxandroid2","rxjava","rxjava2","serialization","sharedpreferences","storage"],"latest_commit_sha":null,"homepage":"","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/pwittchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":["pwittchen"],"custom":["https://paypal.me/pwittchen"]}},"created_at":"2015-02-20T17:25:22.000Z","updated_at":"2025-01-04T07:19:47.000Z","dependencies_parsed_at":"2022-09-01T16:04:53.602Z","dependency_job_id":null,"html_url":"https://github.com/pwittchen/prefser","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/pwittchen/prefser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fprefser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fprefser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fprefser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fprefser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pwittchen","download_url":"https://codeload.github.com/pwittchen/prefser/tar.gz/refs/heads/RxJava2.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fprefser/sbom","scorecard":{"id":750819,"data":{"date":"2025-08-11","repo":{"name":"github.com/pwittchen/prefser","commit":"f0d9d41e0c76ea15da3d032b21b9be2212899fd2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during GetBranch(RxJava1.x): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T20:18:29.878Z","repository_id":27592683,"created_at":"2025-08-22T20:18:29.879Z","updated_at":"2025-08-22T20:18:29.879Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274666572,"owners_count":25327471,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","preferences","rxandroid","rxandroid2","rxjava","rxjava2","serialization","sharedpreferences","storage"],"created_at":"2024-11-07T20:43:08.005Z","updated_at":"2025-09-11T16:17:26.254Z","avatar_url":"https://github.com/pwittchen.png","language":"Java","funding_links":["https://github.com/sponsors/pwittchen","https://paypal.me/pwittchen"],"categories":[],"sub_categories":[],"readme":"Prefser [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Prefser-brightgreen.svg?style=flat-square)](http://android-arsenal.com/details/1/1594)\n=======\nWrapper for Android [SharedPreferences](http://developer.android.com/reference/android/content/SharedPreferences.html) with object serialization and [RxJava](https://github.com/ReactiveX/RxJava) Observables\n\nmin sdk version = 14\n\nJavaDoc is available at: http://pwittchen.github.io/prefser/RxJava2.x\n\n| Current Branch | Branch  | Artifact Id | Build Status  | Coverage | Maven Central |\n|:--------------:|:-------:|:-----------:|:-------------:|:--------:|:-------------:|\n| | [`RxJava1.x`](https://github.com/pwittchen/prefser/tree/RxJava1.x) | `prefser` | [![Build Status for RxJava1.x](https://img.shields.io/travis/pwittchen/prefser/RxJava1.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/prefser) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/prefser/RxJava1.x.svg?style=flat-square\u0026label=coverage)](https://codecov.io/gh/pwittchen/prefser/branch/RxJava1.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/prefser.svg?style=flat-square) |\n| :ballot_box_with_check: | [`RxJava2.x`](https://github.com/pwittchen/prefser/tree/RxJava2.x) | `prefser-rx2` | [![Build Status for RxJava2.x](https://img.shields.io/travis/pwittchen/prefser/RxJava2.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/prefser) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/prefser/RxJava2.x.svg?style=flat-square\u0026label=coverage)](https://codecov.io/gh/pwittchen/prefser/branch/RxJava2.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/prefser-rx2.svg?style=flat-square) |\n\nThis is **RxJava2.x** branch. To see documentation for RxJava1.x, switch to [RxJava1.x](https://github.com/pwittchen/prefser/tree/RxJava1.x) branch.\n\nContents\n--------\n* [Overview](#overview)\n* [Creating Prefser object](#creating-prefser-object)\n* [Saving data](#saving-data)\n* [Reading data](#reading-data)\n  * [get method](#get-method)\n  * [observe mehtod](#observe-method)\n  * [getAndObserve method](#getandobserve-method)\n* [Contains method](#contains-method)\n* [Removing data](#removing-data)\n* [Size of data](#size-of-data)\n* [Getting SharedPreferences object](#getting-sharedpreferences-object)\n* [Subscribing for data updates](#subscribing-for-data-updates)\n* [Examples](#examples)\n* [Download](#download)\n* [Tests](#tests)\n* [Code style](#code-style)\n* [Static code analysis](#static-code-analysis)\n* [Caveats](#caveats)\n* [Who is using this library?](#who-is-using-this-library)\n* [References](#references)\n* [License](#license)\n\nOverview\n--------\n\nPrefser wraps SharedPreferences and thanks to Java Generics provides you simpler API than classic SharedPreferences with the following methods:\n```java\n\u003cT\u003e void put(String key, T value)\n\u003cT\u003e T get(String key, Class\u003cT\u003e classOfT, T defaultValue)\n```\n\nWe can also use `TypeToken` (e.g. for reading serialized Lists):\n```java\n\u003cT\u003e T get(String key, TypeToken\u003cT\u003e typeTokenOfT, T defaultValue)\n```\n\nPrefser will serialize Lists correctly in `put(...)` method and will use `TypeToken` under the hood.\n\nClassic SharedPreferences allows you to store only primitive data types, Strings and Set of Strings.\n\nThanks to Gson serialization, Prefser allows you to store:\n* Primitive data types\n  * boolean\n  * float\n  * int\n  * long\n  * double\n* Strings\n* Custom Objects\n* Lists\n* Arrays\n* Sets\n\nIn addition, Prefser transforms [OnSharedPreferenceChangeListener](http://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener.html) into Observable from RxJava:\n```java\nObservable\u003cString\u003e observePreferences();\n```\n\nYou can subscribe one of this Observable and [monitor updates of SharedPreferences](#subscribing-for-data-updates) with powerful RxJava.\nYou can also [read data from RxJava Observables](#observe-method) in order to monitor single shared preference with a specified key.\n\nCreating Prefser object\n-----------------------\n\nYou can create `Prefser` object in the following ways:\n```java\nPrefser prefser = new Prefser(context);\nPrefser prefser = new Prefser(sharedPreferences);\n```\n\nWhen you create `Prefser` object with Android Context, it will use default `SharedPreferences` from `PreferenceManager`.\n\nYou can set `JsonConverter` implementation for `Prefser`. When it's not set, `Prefser` will use `GsonConverter` by default.\n\n```java\nPrefser prefser = new Prefser(context, jsonConverter);\nPrefser prefser = new Prefser(sharedPreferences, jsonConverter);\n```\n\nSaving data\n-----------\n\nYou can save data with the following method:\n\n```java\n\u003cT\u003e void put(String key, T value)\n```\n\n**Examples**\n\n```java\nprefser.put(\"key\", true);               // put boolean\nprefser.put(\"key\", 43f);                // put float\nprefser.put(\"key\", 42);                 // put int\nprefser.put(\"key\", 42l);                // put long\nprefser.put(\"key\", 42.3);               // put double\nprefser.put(\"key\", \"hello\");            // put String\nprefser.put(\"key\", new CustomObject()); // put CustomObject\n\nprefser.put(\"key\", Arrays.asList(true, false, true));     // put list of booleans\nprefser.put(\"key\", Arrays.asList(1f, 2f, 3f));            // put list of floats\nprefser.put(\"key\", Arrays.asList(1, 2, 3));               // put list of integers\nprefser.put(\"key\", Arrays.asList(1l, 2l, 3l));            // put list of longs\nprefser.put(\"key\", Arrays.asList(1.2, 2.3, 3.4));         // put list of doubles\nprefser.put(\"key\", Arrays.asList(\"one\", \"two\", \"three\")); // put list of Strings\n\nList\u003cCustomClass\u003e objects = Arrays.asList(\n  new CustomObject(),\n  new CustomObject(),\n  new CustomObject());\n\nprefser.put(givenKey, objects); // put list of CustomObjects\n\nprefser.put(\"key\", new Boolean[]{true, false, true});     // put array of booleans\nprefser.put(\"key\", new Float[]{1f, 2f, 3f});              // put array of floats\nprefser.put(\"key\", new Integer[]{1, 2, 3});               // put array of integers\nprefser.put(\"key\", new Long[]{1l, 2l, 3l});               // put array of longs\nprefser.put(\"key\", new Double[]{1.2, 2.3, 3.4});          // put array of doubles\nprefser.put(\"key\", new String[]{\"one\", \"two\", \"three\"});  // put array of Strings\n\nCustomObject[] objects = new CustomObject[]{\n  new CustomObject(),\n  new CustomObject(),\n  new CustomObject()\n};\n\nprefser.put(\"key\", objects); // put array of CustomObjects\n\nSet\u003cString\u003e setOfStrings = new HashSet\u003c\u003e(Arrays.asList(\"one\", \"two\", \"three\"));\nSet\u003cDouble\u003e setOfDoubles = new HashSet\u003c\u003e(Arrays.asList(1.2, 3.4, 5.6));\nprefser.getPreferences().edit().putStringSet(\"key\", setOfStrings).apply(); // put Set of Strings in a \"classical way\"\nprefser.put(\"key\", setOfDoubles); // put set of doubles\n```\n\nReading data\n------------\n\n### get method\n\nYou can read data with the following method:\n\n```java\n\u003cT\u003e T get(String key, Class\u003cT\u003e classOfT, T defaultValue)\n```\n\nor with `TypeToken` (e.g. when reading Lists):\n\n```java\n\u003cT\u003e T get(String key, TypeToken\u003cT\u003e typeTokenOfT, T defaultValue)\n```\n\n**Examples**\n\n```java\n\n// reading primitive types\n\nBoolean value = prefser.get(\"key\", Boolean.class, false);\nFloat value = prefser.get(\"key\", Float.class, 1.0f);\nInteger value = prefser.get(\"key\", Integer.class, 1);\nLong value = prefser.get(\"key\", Long.class, 1.0l);\nDouble value = prefser.get(\"key\", Double.class, 1.0);\nString value = prefser.get(\"key\", String.class, \"default string\");\n\n// reading custom object\n\nCustomObject value = prefser.get(\"key\", CustomObject.class, new CustomObject());\n\n// reading lists\n\n// example with List of Booleans\n\nList\u003cBoolean\u003e defaultBooleans = Arrays.asList(false, false, false);\n\nTypeToken\u003cList\u003cBoolean\u003e\u003e typeToken = new TypeToken\u003cList\u003cBoolean\u003e\u003e() {\n};\n\nList\u003cBoolean\u003e readObject = prefser.get(givenKey, typeToken, defaultBooleans);\n\n// in the same way we can read list of objects of any type including custom objects\n// the only thing we need to do is replacing Boolean type with our desired type\n\n// reading arrays\n\nBoolean[] value = prefser.get(\"key\", Boolean[].class, new Boolean[]{});\nFloat[] value = prefser.get(\"key\", Float[].class, new Float[]{});\nInteger[] value = prefser.get(\"key\", Integer[].class, new Integer[]{});\nLong[] value = prefser.get(\"key\", Long[].class, new Long[]{});\nDouble[] value = prefser.get(\"key\", Double[].class, new Double[]{});\nString[] value = prefser.get(\"key\", String[].class, new String[]{});\nCustomObject[] value = prefser.get(\"key\", CustomObject[].class, new CustomObject[]{});\n\n// reading sets\n\nSet\u003cString\u003e value = prefser.getPreferences().getStringSet(\"key\", new HashSet\u003c\u003e()); // accessing set of strings in a \"classical way\"\nSet\u003cDouble\u003e value = prefser.get(\"key\", Set.class, new HashSet\u003c\u003e());\n```\n\n### observe method\n\nYou can observe changes of data with the following RxJava Observable:\n\n```java\n\u003cT\u003e Observable\u003cT\u003e observe(String key, Class\u003cT\u003e classOfT, T defaultValue)\n```\n\nor with `TypeToken` (e.g when observing Lists):\n\n```java\n\u003cT\u003e Observable\u003cT\u003e observe(String key, TypeToken\u003cT\u003e typeTokenOfT, T defaultValue)\n```\n\n**Note**\n\nUse it, when you want to observe single preference under a specified key.\nWhen you want to observe many preferences, use [observePreferences()](#subscribing-for-data-updates) method.\n\n**Example**\n\n```java\nDisposable subscription = prefser.observe(key, String.class, \"default value\")\n  .subscribeOn(Schedulers.io())\n  ... // you can do anything else, what is possible with RxJava\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(new Consumer\u003cString\u003e() {\n    @Override public void accept(@NonNull String value) {\n    // Perform any action you want.\n    // E.g. display value in a TextView.\n   }\n});\n```\n\n### getAndObserve method\n\nYou can combine functionality of `get(...)` and `observe(...)` methods with `getAndObserve(...)`, which is defined as follows:\n\n```java\n\u003cT\u003e Observable\u003cT\u003e getAndObserve(String key, Class\u003cT\u003e classOfT, T defaultValue)\n```\n\nor with `TypeToken` (e.g. when observing Lists):\n\n```java\n\u003cT\u003e Observable\u003cT\u003e getAndObserve(String key, TypeToken\u003cT\u003e typeTokenOfT, T defaultValue)\n```\n\nYou can subscribe this method in exactly the same way as `observe(...)` method. The only difference is the fact that this method will emit value from SharedPreferences as first element of the stream with `get(...)` method even if SharedPreferences were not changed. When SharedPreferences changes, subscriber will be notified about the change in the same way as in regular `observe(...)` method.\n\nContains method\n-------------\n\nYou can check if data exists under a specified key in the following way:\n\n```java\nprefser.contains(\"key\");\n```\n\nRemoving data\n-------------\n\nYou can remove data under specified key in the following way:\n\n```java\nprefser.remove(\"key\");\n```\n\nWhen you want to clear all SharedPreferences you can use `clear()` method as follows:\n\n```java\nprefser.clear();\n```\n\nSize of data\n------------\n\nYou can read number of all items stored in the SharedPreferences in the following way:\n\n```java\nprefser.size();\n```\n\nGetting SharedPreferences object\n--------------------------------\n\nYou can get `SharedPreferences` object in the following way:\n\n```java\nprefser.getPreferences();\n```\n\nYou can use it for performing operations on `SharedPreferences` without Prefser library. E.g. for reading and writing Set of Strings, what is currently not supported by Prefser. See sections about [saving data](#saving-data) and [reading data](#reading-data) where you can find examples.\n\nSubscribing for data updates\n----------------------------\n\nYou can subscribe the following RxJava Observable from `Prefser` object:\n\n```java\nObservable\u003cString\u003e observePreferences();\n```\n\n**Note**\n\nUse it, when you want to observe many shared preferences.\nIf you want to observe single preference under as specified key, use [observe()](#observe-method) method.\n\n**Example**\n```java\nDisposable subscription = prefser.observePreferences()\n  .subscribeOn(Schedulers.io())\n  .filter(...) // you can filter your updates by key\n  ...          // you can do anything else, what is possible with RxJava\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(new Consumer\u003cString\u003e() {\n    @Override public void accept(@NonNull String key) {\n    // Perform any action you want.\n    // E.g. get value stored under key\n    // and display in a TextView.\n  }\n});\n```\n\nThis subscription can be created e.g. in `onResume()` method, but it depends on your specific implementation and project requirements. Now, everytime when data in SharedPreferences changes, subscriber will be notified under which key value was updated and it can react on that change.\n\n**Unsubscribing from Observable**\n\nWhen you are subscribing for the updates in Activity, please remember to unsubscribe your subscriber in `onPause()` method in the following way:\n\n```java\n@Override\nprotected void onPause() {\n  super.onPause();\n  subscription.dispose();\n}\n```\n\nExamples\n--------\n\n- Examplary app using `Prefser` is available in the `app` directory.\n- If you want to use `Prefser` with [PreferenceActivity](http://developer.android.com/reference/android/preference/PreferenceActivity.html), check out examplary in `app-preference-activity` directory.\n- More usage examples can be found in unit tests in `PrefserTest` class.\n\nDownload\n--------\n\nIf you want to use Observables, besides dependency to Prefser you should also add dependency to RxAndroid.\n\nYou can depend on the library through Maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.pwittchen\u003c/groupId\u003e\n    \u003cartifactId\u003eprefser-rx2\u003c/artifactId\u003e\n    \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.reactivex.rxjava2\u003c/groupId\u003e\n    \u003cartifactId\u003erxandroid\u003c/artifactId\u003e\n    \u003cversion\u003e2.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\nor through Gradle:\n\n```groovy\ndependencies {\n  compile 'com.github.pwittchen:prefser-rx2:x.y.z'\n  compile 'io.reactivex.rxjava2:rxandroid:2.1.1'\n}\n```\n\nWhere `x.y.z` is the latest library release: ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/prefser-rx2.svg?style=flat-square)\n\nTests\n-----\n\nTests are available in `library/src/test/java/` directory and can be executed via CLI with Robolectric with the following command:\n\n```\n./gradlew test\n```\n\nCode style\n----------\n\nCode style used in the project is called `SquareAndroid` from Java Code Styles repository by Square available at: https://github.com/square/java-code-styles.\n\nStatic code analysis\n--------------------\n\nStatic code analysis runs Checkstyle, PMD and Lint. It can be executed with command:\n\n ```\n ./gradlew check\n ```\n\nReports from analysis are generated in `library/build/reports/` directory.\n\nCaveats\n-------\n\n* Set of Strings should be saved and read in a \"classical way\" with `getPreferences()` method.\n* TypeToken is required for proper Lists reading.\n* This library is just a wrapper around SharedPreferences, so it's not a database solution and it's not recommended to use it for large data sets, complicated data operations or adding new data frequently. For such use cases SQLite database or key-value database would be better choice.\n\nWho is using this library?\n--------------------------\n\n* [Toss.im](https://toss.im/toss/eng) - a Korean app for consumer finance on mobile\n* and more...\n\nAre you using this library in your app and want to be listed here? Send me a Pull Request or an e-mail to piotr@wittchen.biz.pl.\n\nReferences\n----------\n\n### General information\n* [SharedPreferences](http://developer.android.com/reference/android/content/SharedPreferences.html)\n* [RxJava](https://github.com/ReactiveX/RxJava)\n* [RxAndroid](https://github.com/ReactiveX/RxAndroid)\n\n### Similar projects\n* [SecureSharedPreferences](https://github.com/rtoshiro/SecureSharedPreferences)\n* [secure-preferences](https://github.com/scottyab/secure-preferences)\n* [Hawk](https://github.com/orhanobut/hawk)\n* [binaryprefs](https://github.com/yandextaxitech/binaryprefs)\n\nLicense\n-------\n\n    Copyright 2015 Piotr Wittchen\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwittchen%2Fprefser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpwittchen%2Fprefser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwittchen%2Fprefser/lists"}