|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.preferences.SDCConfigurationManager
public final class SDCConfigurationManager
Implementation of a management component responsible to handle the
preconfigured default configuration, respectively to read it from the file
and update the default values in a preference manager instance.
The default configuration can be defined in an XML file, which is located in
the projects asset folder.
A configuration example is given in the documentation of the class
SDCConfiguration.
Field Summary | |
---|---|
private boolean |
isUsingExternalConfiguration
Flag for the usage of an uploaded external configuration file; |
private Map<SensorDeviceIdentifier,SensorDeviceConfiguration> |
mapDeviceDefaults
The map with available device defaults |
private SDCConfiguration |
sdcConfiguration
The service configuration |
Constructor Summary | |
---|---|
SDCConfigurationManager(Context appContext,
String configFileName)
Constructor |
Method Summary | |
---|---|
private ServiceConfiguration |
createServiceConfiguration(ApplicationPreferenceManager appPrefManager)
Method to create a service default configuration from the XML file preferences to update the application preference defaults |
private TimeProviderConfiguration |
createTimeProviderConfiguration(ApplicationPreferenceManager appPrefManager)
Method to create a time provider default configuration from the XML file entries to update the application preference defaults |
Set<SensorDeviceIdentifier> |
getListDevices()
Getter for the configured sensor devices |
boolean |
isUsingExternalConfiguration()
Method to test, if an external configuration is used. |
void |
onDestroy()
Method to clean up before class can be destroyed |
private void |
readDefaults(InputStream is)
Does read the defaults from an input stream. |
private void |
readDefaultsFromAssetFolder(Context appContext,
String configFileName)
Does read the defaults from the configuration file |
private boolean |
readDefaultsFromPrivateFileFolder(Context appContext,
String configFileName)
Does read the defaults from the configuration file |
void |
updateDefaults(ApplicationPreferenceManager appPrefManager)
Does update defaults for the managed device preferences |
private void |
updateDefaults(SensorDevicePreferences devicePreferences)
Does update preference defaults by pre-configured defaults if available |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Map<SensorDeviceIdentifier,SensorDeviceConfiguration> mapDeviceDefaults
private SDCConfiguration sdcConfiguration
private final boolean isUsingExternalConfiguration
Constructor Detail |
---|
public SDCConfigurationManager(Context appContext, String configFileName)
appContext
- the application contextconfigFileName
- the configuration file nameMethod Detail |
---|
private final boolean readDefaultsFromPrivateFileFolder(Context appContext, String configFileName)
appContext
- the application contextconfigFileName
- the configuration file nameprivate final void readDefaultsFromAssetFolder(Context appContext, String configFileName)
appContext
- the application contextconfigFileName
- the configuration file nameprivate final void readDefaults(InputStream is) throws Exception
is
- the input stream
Exception
private final void updateDefaults(SensorDevicePreferences devicePreferences)
devicePreferences
- the sensor device to update defaults forpublic final void updateDefaults(ApplicationPreferenceManager appPrefManager)
appPrefManager
- the application preference managerprivate TimeProviderConfiguration createTimeProviderConfiguration(ApplicationPreferenceManager appPrefManager)
appPrefManager
- the application preference manager
private ServiceConfiguration createServiceConfiguration(ApplicationPreferenceManager appPrefManager)
appPrefManager
- the application preference manager
public final void onDestroy()
public Set<SensorDeviceIdentifier> getListDevices()
public boolean isUsingExternalConfiguration()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |