de.unikassel.android.sdcframework.app
Class SDCPreferenceActivity

Package class diagram package SDCPreferenceActivity
java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by android.app.ListActivity
                      extended by android.preference.PreferenceActivity
                          extended by de.unikassel.android.sdcframework.app.SDCPreferenceActivity
All Implemented Interfaces:
ComponentCallbacks, KeyEvent.Callback, LayoutInflater.Factory, View.OnCreateContextMenuListener, Window.Callback

public final class SDCPreferenceActivity
extends PreferenceActivity

The activity for the preference screen.

Does provide the device and service configuration screen. The service and device preference screens will be created dynamically at runtime.
Any defaults configured in the service configuration file in the projects asset folder can be overridden here.
The configured device types in the service configuration will limit the available devices in the preference screen, in the same way as for the service itself.

See Also:
ApplicationPreferenceManagerImpl, SDCConfigurationManager, SensorDeviceAvailabilityTester

Field Summary
private  ApplicationPreferenceManager prefManager
          The preference manager
private static int SCHEDULE_UPDATE
          Scheduler update request code.
 
Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
SDCPreferenceActivity()
          Constructor
 
Method Summary
private  void createDeviceInfoDisplayInfo(PreferenceScreen root)
          Does create the device info display section dynamically in the root screen
private  void createDevicePreferences(PreferenceScreen root)
          Does create the sensor devices preferences dynamically in the root screen
private  void createHostConfiguration(PreferenceScreen root, TransmissionPreference transmissionPreference)
          Does create the host preferences dynamically in the given root screen
private  void createLoggingPreferences(PreferenceScreen root, ServicePreferences servicePrefs)
          Does create the logging preferences dynamically in the given root screen
private  void createPersistentStoragePreferences(PreferenceScreen root, ServicePreferences servicePrefs)
          Does create the persistent storage preferences dynamically in the given root screen
private  void createSampleBroadcastPreferences(PreferenceScreen root, ServicePreferences servicePrefs)
          Does create the sample broadcast service preferences dynamically in the given root screen
private  void createSamplingRelatedPreferences(PreferenceScreen root, ServicePreferences servicePrefs)
          Does create the preferences related to the sampling task dynamically in the given root screen
private  void createServicePreferences(PreferenceScreen root)
          Does create the service preferences dynamically in the root screen
private  void createServiceSchedulerPreferences(PreferenceScreen root)
          Does create the service scheduler section dynamically in the root screen.
private  void createTimeProviderPreferences(PreferenceScreen root)
          Does create the time provider preferences dynamically in the given root screen
private  void createTransmissionPreferences(PreferenceScreen root, ServicePreferences servicePrefs)
          Does create the transmission service preferences dynamically in the given root screen
private  CharSequence[] getLogLevelEntries()
          Does create the log level entries for the list box
private  CharSequence[] getLogLevelEntryValues()
          Does create the log level entry values for the list box
private  CharSequence[] getSensorPriorityLevelEntries()
          Does create the sensor priority level entries for the list box
private  CharSequence[] getSensorPriorityLevelEntryValues()
          Does create the sensor priority level entry values for the list box
private  CharSequence[] getTimeProviderErrorStrategyEntries()
          Does create the time provider error strategy entries for the list box
protected  void onActivityResult(int requestCode, int resultCode, Intent data)
           
protected  void onCreate(Bundle savedInstanceState)
           
protected  boolean onSchedulerStart()
          Handler for scheduler preference selection.
private  void setPreferenceDependencies()
          Does set preference dependencies after tree was created
 
Methods inherited from class android.preference.PreferenceActivity
addPreferencesFromIntent, addPreferencesFromResource, findPreference, getPreferenceManager, getPreferenceScreen, onContentChanged, onDestroy, onNewIntent, onPreferenceTreeClick, onRestoreInstanceState, onSaveInstanceState, onStop, setPreferenceScreen
 
Methods inherited from class android.app.ListActivity
getListAdapter, getListView, getSelectedItemId, getSelectedItemPosition, onListItemClick, setListAdapter, setSelection
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, hasWindowFocus, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onApplyThemeResource, onAttachedToWindow, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareOptionsMenu, onPreparePanel, onRestart, onResume, onRetainNonConfigurationInstance, onSearchRequested, onStart, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, overridePendingTransition, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, showDialog, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
attachBaseContext, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEDULE_UPDATE

private static final int SCHEDULE_UPDATE
Scheduler update request code.

See Also:
Constant Field Values

prefManager

private final ApplicationPreferenceManager prefManager
The preference manager

Constructor Detail

SDCPreferenceActivity

public SDCPreferenceActivity()
Constructor

Method Detail

onCreate

protected void onCreate(Bundle savedInstanceState)
Overrides:
onCreate in class PreferenceActivity

setPreferenceDependencies

private void setPreferenceDependencies()
Does set preference dependencies after tree was created


createServiceSchedulerPreferences

private void createServiceSchedulerPreferences(PreferenceScreen root)
Does create the service scheduler section dynamically in the root screen.

Parameters:
root - the root element to add preferences to

onSchedulerStart

protected boolean onSchedulerStart()
Handler for scheduler preference selection.

Returns:
true if successful, false otherwise

onActivityResult

protected void onActivityResult(int requestCode,
                                int resultCode,
                                Intent data)
Overrides:
onActivityResult in class PreferenceActivity

createDeviceInfoDisplayInfo

private void createDeviceInfoDisplayInfo(PreferenceScreen root)
Does create the device info display section dynamically in the root screen

Parameters:
root - the root element to add preferences to

createServicePreferences

private void createServicePreferences(PreferenceScreen root)
Does create the service preferences dynamically in the root screen

Parameters:
root - the root element to add service preferences to

createTimeProviderPreferences

private void createTimeProviderPreferences(PreferenceScreen root)
Does create the time provider preferences dynamically in the given root screen

Parameters:
root - the root element to add preferences to

createLoggingPreferences

private void createLoggingPreferences(PreferenceScreen root,
                                      ServicePreferences servicePrefs)
Does create the logging preferences dynamically in the given root screen

Parameters:
root - the root element to add preferences to
servicePrefs - the service preference to create from

createSamplingRelatedPreferences

private void createSamplingRelatedPreferences(PreferenceScreen root,
                                              ServicePreferences servicePrefs)
Does create the preferences related to the sampling task dynamically in the given root screen

Parameters:
root - the root element to add preferences to
servicePrefs - the service preference to create from

createSampleBroadcastPreferences

private void createSampleBroadcastPreferences(PreferenceScreen root,
                                              ServicePreferences servicePrefs)
Does create the sample broadcast service preferences dynamically in the given root screen

Parameters:
root - the root element to add preferences to
servicePrefs - the service preference to create from

createTransmissionPreferences

private void createTransmissionPreferences(PreferenceScreen root,
                                           ServicePreferences servicePrefs)
Does create the transmission service preferences dynamically in the given root screen

Parameters:
root - the root element to add preferences to
servicePrefs - the service preference to create from

createHostConfiguration

private void createHostConfiguration(PreferenceScreen root,
                                     TransmissionPreference transmissionPreference)
Does create the host preferences dynamically in the given root screen

Parameters:
root - the root element to add preferences to
transmissionPreference - the transmission preference to create from

createPersistentStoragePreferences

private void createPersistentStoragePreferences(PreferenceScreen root,
                                                ServicePreferences servicePrefs)
Does create the persistent storage preferences dynamically in the given root screen

Parameters:
root - the root element to add preferences to
servicePrefs - the service preference to create from

createDevicePreferences

private void createDevicePreferences(PreferenceScreen root)
Does create the sensor devices preferences dynamically in the root screen

Parameters:
root - the root element to add device preferences to

getSensorPriorityLevelEntries

private CharSequence[] getSensorPriorityLevelEntries()
Does create the sensor priority level entries for the list box

Returns:
the sensor priority level entries for the list box

getSensorPriorityLevelEntryValues

private CharSequence[] getSensorPriorityLevelEntryValues()
Does create the sensor priority level entry values for the list box

Returns:
the sensor priority level entry values for the list box

getTimeProviderErrorStrategyEntries

private CharSequence[] getTimeProviderErrorStrategyEntries()
Does create the time provider error strategy entries for the list box

Returns:
the time provider error strategy entries for the list box

getLogLevelEntries

private CharSequence[] getLogLevelEntries()
Does create the log level entries for the list box

Returns:
the log level entries for the list box

getLogLevelEntryValues

private CharSequence[] getLogLevelEntryValues()
Does create the log level entry values for the list box

Returns:
the log level entry values for the list box