org.solovyev.android.keyboard
Class AbstractAKeyboardInputMethodService

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.app.Service
              extended by android.inputmethodservice.AbstractInputMethodService
                  extended by android.inputmethodservice.InputMethodService
                      extended by org.solovyev.android.keyboard.AbstractAKeyboardInputMethodService
All Implemented Interfaces:
android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.view.KeyEvent.Callback
Direct Known Subclasses:
CalculatorDragInputMethodService, LatinDragInputMethodService, LatinInputMethodService

public abstract class AbstractAKeyboardInputMethodService
extends android.inputmethodservice.InputMethodService

Example of writing an input method for a soft keyboard. This code is focused on simplicity over completeness, so it should in no way be considered to be a complete soft keyboard implementation. Its purpose is to provide a basic example for how you would get started writing an input method, to be fleshed out as appropriate.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.inputmethodservice.InputMethodService
android.inputmethodservice.InputMethodService.InputMethodImpl, android.inputmethodservice.InputMethodService.InputMethodSessionImpl, android.inputmethodservice.InputMethodService.Insets
 
Nested classes/interfaces inherited from class android.inputmethodservice.AbstractInputMethodService
android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl, android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl
 
Field Summary
 
Fields inherited from class android.inputmethodservice.InputMethodService
BACK_DISPOSITION_DEFAULT, BACK_DISPOSITION_WILL_DISMISS, BACK_DISPOSITION_WILL_NOT_DISMISS
 
Fields inherited from class android.app.Service
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_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, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_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, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_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
protected AbstractAKeyboardInputMethodService(AKeyboardController keyboardController)
           
 
Method Summary
 void onCreate()
           
 android.view.View onCreateCandidatesView()
           
 android.view.View onCreateInputView()
           
 void onCurrentInputMethodSubtypeChanged(android.view.inputmethod.InputMethodSubtype subtype)
           
 void onDisplayCompletions(android.view.inputmethod.CompletionInfo[] completions)
           
 void onFinishInput()
           
 void onInitializeInterface()
           
 boolean onKeyDown(int keyCode, android.view.KeyEvent event)
           
 boolean onKeyUp(int keyCode, android.view.KeyEvent event)
           
 void onStartInput(android.view.inputmethod.EditorInfo attribute, boolean restarting)
           
 void onStartInputView(android.view.inputmethod.EditorInfo attribute, boolean restarting)
           
 void onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd)
           
 
Methods inherited from class android.inputmethodservice.InputMethodService
dump, getBackDisposition, getCandidatesHiddenVisibility, getCurrentInputBinding, getCurrentInputConnection, getCurrentInputEditorInfo, getCurrentInputStarted, getLayoutInflater, getMaxWidth, getTextForImeAction, getWindow, hideStatusIcon, hideWindow, isExtractViewShown, isFullscreenMode, isInputViewShown, isShowInputRequested, onAppPrivateCommand, onBindInput, onComputeInsets, onConfigurationChanged, onConfigureWindow, onCreateExtractTextView, onCreateInputMethodInterface, onCreateInputMethodSessionInterface, onDestroy, onEvaluateFullscreenMode, onEvaluateInputViewShown, onExtractedCursorMovement, onExtractedSelectionChanged, onExtractedTextClicked, onExtractingInputChanged, onExtractTextContextMenuItem, onFinishCandidatesView, onFinishInputView, onKeyLongPress, onKeyMultiple, onShowInputRequested, onStartCandidatesView, onTrackballEvent, onUnbindInput, onUpdateCursor, onUpdateExtractedText, onUpdateExtractingViews, onUpdateExtractingVisibility, onViewClicked, onWindowHidden, onWindowShown, requestHideSelf, sendDefaultEditorAction, sendDownUpKeyEvents, sendKeyChar, setBackDisposition, setCandidatesView, setCandidatesViewShown, setExtractView, setExtractViewShown, setInputView, setTheme, showStatusIcon, showWindow, switchInputMethod, updateFullscreenMode, updateInputViewShown
 
Methods inherited from class android.inputmethodservice.AbstractInputMethodService
getKeyDispatcherState, onBind
 
Methods inherited from class android.app.Service
getApplication, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTrimMemory, onUnbind, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
 
Methods inherited from class android.content.ContextWrapper
attachBaseContext, 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, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, 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
 

Constructor Detail

AbstractAKeyboardInputMethodService

protected AbstractAKeyboardInputMethodService(@Nonnull
                                              AKeyboardController keyboardController)
Method Detail

onCreate

public void onCreate()
Overrides:
onCreate in class android.inputmethodservice.InputMethodService

onInitializeInterface

public void onInitializeInterface()
Overrides:
onInitializeInterface in class android.inputmethodservice.InputMethodService

onCreateInputView

public android.view.View onCreateInputView()
Overrides:
onCreateInputView in class android.inputmethodservice.InputMethodService

onCreateCandidatesView

public android.view.View onCreateCandidatesView()
Overrides:
onCreateCandidatesView in class android.inputmethodservice.InputMethodService

onStartInput

public void onStartInput(@Nonnull
                         android.view.inputmethod.EditorInfo attribute,
                         boolean restarting)
Overrides:
onStartInput in class android.inputmethodservice.InputMethodService

onFinishInput

public void onFinishInput()
Overrides:
onFinishInput in class android.inputmethodservice.InputMethodService

onStartInputView

public void onStartInputView(android.view.inputmethod.EditorInfo attribute,
                             boolean restarting)
Overrides:
onStartInputView in class android.inputmethodservice.InputMethodService

onCurrentInputMethodSubtypeChanged

public void onCurrentInputMethodSubtypeChanged(android.view.inputmethod.InputMethodSubtype subtype)
Overrides:
onCurrentInputMethodSubtypeChanged in class android.inputmethodservice.InputMethodService

onUpdateSelection

public void onUpdateSelection(int oldSelStart,
                              int oldSelEnd,
                              int newSelStart,
                              int newSelEnd,
                              int candidatesStart,
                              int candidatesEnd)
Overrides:
onUpdateSelection in class android.inputmethodservice.InputMethodService

onDisplayCompletions

public void onDisplayCompletions(@Nullable
                                 android.view.inputmethod.CompletionInfo[] completions)
Overrides:
onDisplayCompletions in class android.inputmethodservice.InputMethodService

onKeyDown

public boolean onKeyDown(int keyCode,
                         android.view.KeyEvent event)
Specified by:
onKeyDown in interface android.view.KeyEvent.Callback
Overrides:
onKeyDown in class android.inputmethodservice.InputMethodService

onKeyUp

public boolean onKeyUp(int keyCode,
                       android.view.KeyEvent event)
Specified by:
onKeyUp in interface android.view.KeyEvent.Callback
Overrides:
onKeyUp in class android.inputmethodservice.InputMethodService


Copyright © 2013. All Rights Reserved.