org.android.activityminer.app.evaluation
Class EvaluationActivity

Package class diagram package EvaluationActivity
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 org.android.activityminer.app.util.SharedPreferenceChangeAwareActivity
                      extended by org.android.activityminer.app.util.ServiceBasedActivity
                          extended by org.android.activityminer.app.evaluation.EvaluationActivity
All Implemented Interfaces:
ComponentCallbacks, ComponentCallbacks2, KeyEvent.Callback, LayoutInflater.Factory, LayoutInflater.Factory2, View.OnCreateContextMenuListener, Window.Callback, GenericServiceConnectionHolder.ServiceConnectionEventReceiver<IBackgroundService>, SharedPreferenceChangeNotificationReceiver, SharedPreferenceChangeObserver

public final class EvaluationActivity
extends ServiceBasedActivity

The main Activity.


Field Summary
private  MenuItem browseLastResult
          The option menu entry for exploration of last result.
private  Button btnEvalAllFeaturesButton
          The button for evaluation of all features.
private  Button btnEvalAllFeatureSetsOfSizeK
          The button for evaluation of all feature sets of a given size.
private  Button btnEvalAnyFeatureCombinationButton
          The button for evaluation of all possible feature combinations.
private  Button btnEvalSelectedFeaturesButton
          The button for evaluation of configured feature selection.
private  Button btnEvalSingleFeaturesButton
          The button for single feature evaluation.
private  String outputFile
          The output file to store the last result in.
 
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, APP_OPS_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
 
Constructor Summary
EvaluationActivity()
          Constructor
 
Method Summary
 boolean doesOutPutFileExist()
          Test method for an existing file with evaluation results.
 void doEvaluate(Configuration configuration, Set<Set<FeatureTypes>> featuresSets, boolean bestResultsOnly)
          Does start an evaluation task for the given feature sets and the given configuration.
 void doFeatureSubsetSearch(Configuration configuration, Set<Set<FeatureTypes>> featuresSets, int size)
          Does start a search task for the best subset of a given size in a given feature set.
protected  void handleTaskFinishedEvent(TaskFinishedEvent taskFinishedEvent)
          Handler for task finished events
 boolean isInterestedInLimitViolations()
          Method to test if limit violations should be notified.
protected  void onAllFeatureEvaluation()
          Handler for evaluation of all features.
private  boolean onBrowseLastResult()
          Handler for last result browsing
private  boolean onConfiguration()
          Option menu handler for configuration.
 void onConfigurationChanged(Configuration newConfig)
           
protected  void onCreate(Bundle savedInstanceState)
           
 boolean onCreateOptionsMenu(Menu menu)
           
protected  void onEvaluationOfAnySelectedFeatureCombination()
          Handler for evaluation of all possible combinations of the selected features.
protected  void onEvaluationOfBestSetWithKFeatures()
          Handler for evaluation of the best set with 8 features for powerset evaluation.
protected  void onEvaluationOfConfiguredFeatures()
          Handler for evaluation of the configured feature set.
 boolean onOptionsItemSelected(MenuItem item)
           
protected  void onResume()
           
protected  void onServiceFinishedCurrentTask(TaskFinishedEvent event)
          Handler for finished service tasks
protected  void onSingleFeatureEvaluation()
          Handler for evaluation of single features.
private  void prepare()
          Preparation in case of creation or orientation changes.
private  boolean testForSufficientTrainingDataForSelectedClasses()
          Test method if sufficient recorded sample data are available for the selected classes.
 void updateMenuItemStates()
          Does update the menu item states.
 
Methods inherited from class org.android.activityminer.app.util.ServiceBasedActivity
getService, getServiceState, isServiceAvailable, onAboutToDisconnect, onBackgroundTaskProgress, onBindingFailed, onConnectionEstablished, onConnectionLost, onDefaultTaskFinishedEvent, onNewIntent, onPause, onServiceUnavailable, safeUnregisterReceiver, showServiceTaskFinishedResult, startBackgroundServiceProgressObservation, stopBackgroundServiceProgressObservation
 
Methods inherited from class org.android.activityminer.app.util.SharedPreferenceChangeAwareActivity
getConfiguration, onBetaPreferenceChange, onBWCutOffPreferenceChanged, onBWFilterOrderPreferenceChanged, onClassSelectionChange, onCountDownTimeChange, onCrossValidationParameterKChange, onDefaultRecordingTimeChange, onDestroy, onEvaluationAccuracyThresholdChanged, onFeatureSelection, onGravitationCutOffPreferenceChanged, onKNNClassifierParameterKChange, onKNNClassifierParameterNormalizeChange, onLimitViolation, onLocationDataUsageFlagChange, onMaximumRecordingTimeChange, onMaximumSampleRateChange, onMinCutOffPreferenceChanged, onOverlapSizeChange, onOwnLinAccImplementationUsageFlagChange, onSampleRateChange, onSelectedAccFilterChanged, onSelectedClassifierChange, onWindowSizeChange
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isTaskRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityResult, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackPressed, onChildTitleChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistData, onRestart, onRestoreInstanceState, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, recreate, registerForContextMenu, removeDialog, reportFullyDrawn, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, attachBaseContext, getResources, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

btnEvalSingleFeaturesButton

private Button btnEvalSingleFeaturesButton
The button for single feature evaluation.


btnEvalAllFeaturesButton

private Button btnEvalAllFeaturesButton
The button for evaluation of all features.


btnEvalAnyFeatureCombinationButton

private Button btnEvalAnyFeatureCombinationButton
The button for evaluation of all possible feature combinations.


btnEvalSelectedFeaturesButton

private Button btnEvalSelectedFeaturesButton
The button for evaluation of configured feature selection.


btnEvalAllFeatureSetsOfSizeK

private Button btnEvalAllFeatureSetsOfSizeK
The button for evaluation of all feature sets of a given size.


outputFile

private String outputFile
The output file to store the last result in.


browseLastResult

private MenuItem browseLastResult
The option menu entry for exploration of last result.

Constructor Detail

EvaluationActivity

public EvaluationActivity()
Constructor

Method Detail

prepare

private final void prepare()
Preparation in case of creation or orientation changes.


onCreate

protected final void onCreate(Bundle savedInstanceState)
Overrides:
onCreate in class ServiceBasedActivity

onResume

protected final void onResume()
Overrides:
onResume in class ServiceBasedActivity

handleTaskFinishedEvent

protected void handleTaskFinishedEvent(TaskFinishedEvent taskFinishedEvent)
Description copied from class: ServiceBasedActivity
Handler for task finished events

Overrides:
handleTaskFinishedEvent in class ServiceBasedActivity
Parameters:
taskFinishedEvent - the task finished event

doesOutPutFileExist

public final boolean doesOutPutFileExist()
Test method for an existing file with evaluation results.

Returns:
true if exists false otherwise

onConfigurationChanged

public final void onConfigurationChanged(Configuration newConfig)
Specified by:
onConfigurationChanged in interface ComponentCallbacks
Overrides:
onConfigurationChanged in class Activity

onCreateOptionsMenu

public final boolean onCreateOptionsMenu(Menu menu)
Overrides:
onCreateOptionsMenu in class Activity

updateMenuItemStates

public final void updateMenuItemStates()
Does update the menu item states.


onOptionsItemSelected

public final boolean onOptionsItemSelected(MenuItem item)
Overrides:
onOptionsItemSelected in class Activity

onSingleFeatureEvaluation

protected final void onSingleFeatureEvaluation()
Handler for evaluation of single features.


onAllFeatureEvaluation

protected final void onAllFeatureEvaluation()
Handler for evaluation of all features.


onEvaluationOfAnySelectedFeatureCombination

protected final void onEvaluationOfAnySelectedFeatureCombination()
Handler for evaluation of all possible combinations of the selected features.


onEvaluationOfBestSetWithKFeatures

protected final void onEvaluationOfBestSetWithKFeatures()
Handler for evaluation of the best set with 8 features for powerset evaluation.


onEvaluationOfConfiguredFeatures

protected final void onEvaluationOfConfiguredFeatures()
Handler for evaluation of the configured feature set.


doEvaluate

public final void doEvaluate(Configuration configuration,
                             Set<Set<FeatureTypes>> featuresSets,
                             boolean bestResultsOnly)
Does start an evaluation task for the given feature sets and the given configuration.

Parameters:
configuration - the configuration for evaluation
featuresSets - the feature sets to evaluate
bestResultsOnly - flag to limit the result list to the best results (ranked by overall prediction accuracy)

doFeatureSubsetSearch

public final void doFeatureSubsetSearch(Configuration configuration,
                                        Set<Set<FeatureTypes>> featuresSets,
                                        int size)
Does start a search task for the best subset of a given size in a given feature set.

Parameters:
configuration - the configuration for evaluation
featuresSets - a set containing a single feature set to evaluate
size -

testForSufficientTrainingDataForSelectedClasses

private final boolean testForSufficientTrainingDataForSelectedClasses()
Test method if sufficient recorded sample data are available for the selected classes.

Returns:
true if enough sample data are available.

onConfiguration

private final boolean onConfiguration()
Option menu handler for configuration.

Returns:
true if successful, false otherwise

isInterestedInLimitViolations

public final boolean isInterestedInLimitViolations()
Description copied from interface: SharedPreferenceChangeNotificationReceiver
Method to test if limit violations should be notified.

Specified by:
isInterestedInLimitViolations in interface SharedPreferenceChangeNotificationReceiver
Overrides:
isInterestedInLimitViolations in class SharedPreferenceChangeAwareActivity
Returns:
true if interested in notifications, false otherwise

onBrowseLastResult

private final boolean onBrowseLastResult()
Handler for last result browsing

Returns:
true if successful

onServiceFinishedCurrentTask

protected void onServiceFinishedCurrentTask(TaskFinishedEvent event)
Description copied from class: ServiceBasedActivity
Handler for finished service tasks

Specified by:
onServiceFinishedCurrentTask in class ServiceBasedActivity
Parameters:
event - the task finished event