SDMConfiguration

Each low level API has its own defaults/constants set in the SDMConfiguration library. Default values of preferences can be found in the SDMConstants class.

List of Features

SDMConfiguration Public APIs

ISDMPreferences

void setPreference(String key, String value)
String getPreference(String key)
void registerPreferenceChangeListener(String key, ISDMPreferenceChangeListener changeListener)
void unRegisterPreferenceChangeListener(String key, ISDMPreferenceChangeListener changeListener)
Hashtable encrypt()
Hashtable decrypt()
void initFromPersistence(Hashtable prefs)
void deletePreference(final String aKey)
void reset()

Technical Details

SDMPreferences object is used for storing configuration key-value pairs. Only the String representation of the value can be stored. Persistent storage of this object is available from SDMPersistence. This object calls encrypt(), decrypt() and initFromPersistence() methods of SDMPreferences, so the applications do not have to use these methods explicitly.

During instantiation of SDMPreference, the default values needed for other SDMComponents are filled. SDMComponents preferences can be reset to their default values using the reset() method.

You can register a preference change listener for each preference in SDMPreferences (including custom preferences) so that you will be notified if the value of a given preference has changed. Preference change listener notification and preference validation can only be done after the initialization of the appropriate component.