simplekeyvaluestorage

A simple Shared preference wrapper to store POJO objects in Android serialized with gson

Лицензия

Лицензия

Категории

Категории

KeY Данные Data Formats Formal Verification
Группа

Группа

com.quinientoscuarenta
Идентификатор

Идентификатор

simplekeyvaluestorage
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

aar
Описание

Описание

simplekeyvaluestorage
A simple Shared preference wrapper to store POJO objects in Android serialized with gson
Ссылка на сайт

Ссылка на сайт

https://github.com/540/simplekeyvaluestorage
Система контроля версий

Система контроля версий

https://github.com/540/simplekeyvaluestorage

Скачать simplekeyvaluestorage

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.quinientoscuarenta/simplekeyvaluestorage/ -->
<dependency>
    <groupId>com.quinientoscuarenta</groupId>
    <artifactId>simplekeyvaluestorage</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.quinientoscuarenta/simplekeyvaluestorage/
implementation 'com.quinientoscuarenta:simplekeyvaluestorage:1.0.1'
// https://jarcasting.com/artifacts/com.quinientoscuarenta/simplekeyvaluestorage/
implementation ("com.quinientoscuarenta:simplekeyvaluestorage:1.0.1")
'com.quinientoscuarenta:simplekeyvaluestorage:aar:1.0.1'
<dependency org="com.quinientoscuarenta" name="simplekeyvaluestorage" rev="1.0.1">
  <artifact name="simplekeyvaluestorage" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.quinientoscuarenta', module='simplekeyvaluestorage', version='1.0.1')
)
libraryDependencies += "com.quinientoscuarenta" % "simplekeyvaluestorage" % "1.0.1"
[com.quinientoscuarenta/simplekeyvaluestorage "1.0.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.google.code.gson : gson jar 2.6.2
com.android.support » appcompat-v7 jar 23.2.1

Модули Проекта

Данный проект не имеет модулей.

SimpleKeyValueStorage

Build Status Download Maven Central


A simple Shared preference wrapper to store POJO objects in Android, serialized with gson.

Library Objectives

Tired of having to manually serialize/unserialize objects content into shared preferences this library uses gson to automate object serialization and make painless object storage into shared preferences. Objects are stored json encoded.

Installation

Grab via Gradle:

compile 'com.quinientoscuarenta:simplekeyvaluestorage:1.0.1'

or Maven:

<dependency>
  <groupId>com.quinientoscuarenta</groupId>
  <artifactId>simplekeyvaluestorage</artifactId>
  <version>1.0.1</version>
</dependency>

Usage

Initialize:

You can initialize it with default name 'skvs_default_prefs'

SimpleKeyValueStorage.initDefault(context);

Or with custom name

SimpleKeyValueStorage.builder().withName('custom_name').init(context);

You will have to provide a context, it can be application or activity context.

Use:

Set method accepts any type such as list, object, primitive...

Locale locale = Locale.ENGLISH;
simpleKeyValueStorage.set("key", locale);

Get or get list and specify the content type to retrieve the saved value

Locale savedLocale = simpleKeyValueStorage.get("key", Locale.class);

List<String> savedStrings = simpleKeyValueStorage.getList("key", String[].class);

Delete value

simpleKeyValueStorage.delete("key");

Check data availability

boolean available = simpleKeyValueStorage.isSet("key");

Clear all storage

simpleKeyValueStorage.clear();

Proguard

#Gson
-keep class com.google.gson.** { *; }
-keepattributes Signature

License

Copyright 2015 Gorka Moreno Asín

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
com.quinientoscuarenta

540

Версии библиотеки

Версия
1.0.1
1.0.0