public class SoftKeyboardActivity extends android.app.Activity implements KeyboardPanel.OnKeystrokeListener
The setup parameters are embedded in the application. The default settings (shown) may be changed via the setup dialog. Changes may be saved. Saved changes become the default settings when the application is next launched. The setup parameters are as follows:
Parameter Description Participant Code Identifies the current participant. This is used in forming the names for the output data files. Also, the sd2 output data file includes a column with the participant code.
Session Code Identifies the session. Useful if testing proceeds over multiple sessions to gauge the progression of learning. The session code is used in forming the name for the output data file. Also, the sd2 output data file contains a column with the session code. Note: The setup dialog does not include an entry for "Block code". The block code is generated automatically by the software.
Group Code Identifies the group to which the participant was assigned. The group code is used in forming the name for the output data file. Also, the sd2 output data file contains a column with the group code. A group code is useful if counterbalancing was used (i.e., participants were assigned to groups to offset order effects). This is common practice for testing the levels of a within-subjects independent variable.
Condition Code An arbitrary code used to associate a test condition with this invocation. This parameter might be useful if the software is used in an experiment that investigates conditions that are not inherently part of the application (e.g., Gender → male, female; User position → sitting, standing, walking). The condition code is used in forming the name for the output data file. Also, the sd2 output data file contains a column with the condition code.
Keyboard Layout Used to select the keyboard layout. Different keyboard layouts are defined in resource file embedded in the application. The options currently supported are as follows: (click to enlarge)
Qwerty
Keyboard Scale Adjusts the size of the keyboard using the specified scaling factor. This parameter allows the keyboard size to be adjusted without changing the keyboard definition in the resource file. A scale setting of 1 leaves the keyboard size as specified in the corresponding resource file. The value entered will be parsed to a
float
before it is passed on to the main activity. If the value entered is not parsable to afloat
, a 20-ms vibrotactile pulse is emitted to signal that a correction is required.The keyboard scale is used in forming the name for the output data file. Also, the sd2 output data file contains a column with the keyboard scale.
Offset From Bottom Specifies the distance from bottom of the display where the soft keyboard is positioned. The value is in Android's "density independent pixels" (dip), where 1 inch = 160 dip. The value entered will be parsed to a
float
before it is passed on to the main activity. If the value entered is not parsable to afloat
, a 20-ms vibrotactile pulse is emitted to signal that a correction is required.
Number of Phrases Specifies the number of phrases presented to the participant in the current block.
Phrases File Specifies a file containing phrases of text to be presented to participants for entry. Phrases are drawn from the file at random. Typically, phrases2.txt is used. This is the phrase set published by MacKenzie and Soukoreff in 2003 (see Related References, above). Other file names may be specified. For example, the file quickbrownfox.txt contains the phrase
the quick brown fox jumps over the lazy dogThis phrase might be useful for demonstration or specialized testing.
Show Popup Key A checkbox item that determines whether or not a popup key appears above an alpha key when touched.
Lowercase Only A checkbox item that determines whether uppercase and lowercase letters are permitted in the presented text phrases. If checked, any uppercase letters in the presented text phrases are converted to lowercase.
Show Presented Text During Input A checkbox item that determines whether or not the presented text is visible during entry of a phrase. Either way, the text phrase appears at the beginning of a trial. If this option is unchecked, the phrase will disappear when the first keystroke is entered.
Text is entered by tapping with a finger on keys on the soft keyboard. The transcribed text appears below the presented text in a separate text field. Timing and data collection begin with the first tap on the soft keyboard.
An example using a Google Nexus 4 with the Qwerty keyboard is shown below on the left: (click to enlarge)
Since the user's finger is likely to obscure the intended key, a popup key appears above the touched key. This is shown in the middle image above (the user's finger is on the c-key). The popup key only appears if the corresponding option in the setup dialog is selected. If the wrong key appears, the user may slide her finger to the correct key. As the finger slides, the popup key changes accordingly. Selection occurs on finger-lift. Input is aborted if the finger slides off the keyboard before finger-lift.
If a mistake is made, the "Bksp" may be tapped to erase the last character entered.
At the end of a phrase, the user taps "Enter", whereupon timing and data collection end. A results popup shows the presented and transcribed text phrases, the entry speed (in words per minute), the error rate (%), and the keystrokes per character (KSPC). An example is shown in the right image above.
When the user taps "OK", the next phrase appears for input. After the specified number of phrases are entered, the application terminates.
Below are examples of the UI showing the effect of different settings from the setup dialog. The device is a Google Nexus 5. In the image on the left, "Keyboard Scale" = 1.0 and "Offset From Bottom" = 40. In the image on the right, "Keyboard Scale" = 0.75 and "Offset From Bottom" = 440.
There are two output data files, an "sd1" file and an "sd2" file. ("sd" is for "summary data".) The sd1 file contains data on a keystroke by keystroke basis, including timestamps. The sd2 file contains summary data for each phrase, one line per phrase. Examples follow:
Actual output files use "SoftKeyboardExperiment" as the base filename. This is followed by the
participant code, the session code, the block code, the group code, the condition code, and the
layout name. An example might be
SoftKeyboardExperiment-P01-S01-B01-G01-C01-Qwerty-Scale_0.8.sd1
.
In most cases, the sd2 data files are the primary files used for data analyses in an experimental evaluation. The data in the sd2 files are full-precision, comma-delimited, to facilitate importing into a spreadsheet or statistics application. Below is an example for the sd2 file above, after importing into Microsoft Excel: (click to enlarge)
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
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_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, FINGERPRINT_SERVICE, HARDWARE_PROPERTIES_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_STATS_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SHORTCUT_SERVICE, STORAGE_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
Constructor and Description |
---|
SoftKeyboardActivity() |
Modifier and Type | Method and Description |
---|---|
void |
doEndOfPhrase() |
void |
doNewPhrase() |
int |
getDefaultDeviceOrientation() |
void |
onCreate(android.os.Bundle savedInstanceState) |
void |
onKeystroke(ca.yorku.cse.mack.softkeyboard.KeyboardEvent ke) |
static float |
wpm(java.lang.String text,
long msTime) |
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, enterPictureInPictureMode, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMediaController, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onActivityResult, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDestroy, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onLowMemory, onMenuItemSelected, onMenuOpened, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPictureInPictureModeChanged, onPostCreate, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onRequestPermissionsResult, onRestart, onRestoreInstanceState, onRestoreInstanceState, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onStateNotSaved, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, postponeEnterTransition, recreate, registerForContextMenu, releaseInstance, removeDialog, reportFullyDrawn, requestDragAndDropPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, runOnUiThread, setActionBar, setContentTransitionManager, setContentView, setContentView, setContentView, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setMediaController, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTaskDescription, setTheme, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, setVrModeEnabled, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
applyOverrideConfiguration, attachBaseContext, getAssets, getResources, getTheme
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, 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
public static float wpm(java.lang.String text, long msTime)
public void onCreate(android.os.Bundle savedInstanceState)
onCreate
in class android.app.Activity
public int getDefaultDeviceOrientation()
public void onKeystroke(ca.yorku.cse.mack.softkeyboard.KeyboardEvent ke)
onKeystroke
in interface KeyboardPanel.OnKeystrokeListener
public void doNewPhrase()
public void doEndOfPhrase()