Package com.unblu.sdk.core.configuration
Interface UnbluPreferencesStorage
public interface UnbluPreferencesStorage
Interface which can be implemented to store the preferences of Unblu at a custom location.
This is useful if encryption should used. Alternatively you can obtain a default implementation by calling
This is useful if encryption should used. Alternatively you can obtain a default implementation by calling
createSharedPreferencesStorage(Context)
.
IMPORTANT: If you change the custom storage, make sure you can migrate the old data to the new storage.
-
Method Summary
Modifier and TypeMethodDescriptionstatic UnbluPreferencesStorage
createSharedPreferencesStorage
(android.content.Context context) Creates a default implementation ofUnbluPreferencesStorage
which stores the preferences inside theSharedPreferences
of the app with modeContext.MODE_PRIVATE
Read a preference from the storagevoid
Stores a preference in the storage.
-
Method Details
-
put
Stores a preference in the storage. Passing innull
deletes the value.- Parameters:
key
- The key of the preferencevalue
- The value for the given key
-
get
Read a preference from the storage- Parameters:
key
- The key of the preference- Returns:
- The value for the given key. Can be null if there is no value stored for the key provided.