public final class Armadillo
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Armadillo.Builder
Builder pattern for creating the configuration for an
ArmadilloSharedPreferences instance |
| Modifier and Type | Field and Description |
|---|---|
static int |
CONTENT_KEY_OUT_BYTE_LENGTH |
static int |
DEFAULT_PROTOCOL_VERSION |
static int |
KITKAT_PROTOCOL_VERSION |
| Modifier and Type | Method and Description |
|---|---|
static Armadillo.Builder |
create(android.content.Context context,
java.lang.String preferenceName)
Create a new builder for Armadillo.
|
static Armadillo.Builder |
create(android.content.SharedPreferences sharedPreferences)
Create a new instance of the builder with a custom implementation of shared preference.
|
public static final int CONTENT_KEY_OUT_BYTE_LENGTH
public static final int DEFAULT_PROTOCOL_VERSION
public static final int KITKAT_PROTOCOL_VERSION
public static Armadillo.Builder create(android.content.SharedPreferences sharedPreferences)
SharedPreferences
instance, use this create. This is also useful for testing purposes.
Note that this is a more advanced feature and usually you want
the default implementation with create(Context, String).
sharedPreferences - to use as backing persistence layerpublic static Armadillo.Builder create(android.content.Context context, java.lang.String preferenceName)
SharedPreferences from
given context. Pass the preference name (think of database name), which is unique to your
persistence layer (e.g. if you create with the same preference name you will get the old
stored values).
This name will be used to derive the file name used to store the shared preference xml on disk (read: it will be hashed, not directly used).
context - to get shared preference and other Android OS specific datapreferenceName - to identify the persistence store