Create input method editors on Wear
Stay organized with collections
Save and categorize content based on your preferences.
Wear OS supports input methods beyond voice by extending the
Android input method editor (IME) framework. The IME framework provides support
for virtual, on-screen keyboards that let users input text in the form of
keyclicks, handwriting, or gestures.
Wear OS users can choose between various input options from Remote Input. These options include:
- Dictation
- Emoji
- Canned responses
- Smart Reply
- Default IME
Create an input method for Wear
The Android platform provides a standard framework for creating IMEs. To create
a Wear-OS-specific IME, you need to optimize your IME for a wearable's limited screen size.
Wear-OS-specific IME filters
To learn how to create an input method for Wear OS, follow the guide to
create an input method on handsets.
Then add the Google Play filters in the following sections to your manifest file to make it a Wear-OS-specific IME.
API level
If you are developing an IME for Wear OS, remember that the
feature is supported only on Android 6.0 (API level 23) and higher.
To ensure that your IME can be installed only on wearables that support input
methods beyond voice, add the following to your app's manifest:
<uses-sdk android:minSdkVersion="23" />
Device feature sets
To control how your app is filtered from devices that don't support
Wear OS IMEs, such as iPhones, add the following to your app's manifest:
<uses-feature android:required="true" android:name="android.hardware.type.watch" />
Invoke an input method
Wear OS provides user settings on the watch that let the user enable multiple
IMEs from the list of installed IMEs. Once the user enables your IME, they
can invoke your IME from the following places:
- A notification or an app using the
RemoteInput API.
- Wear OS apps with an
EditText
field. Touching a text field places the cursor in the field and automatically
displays the IME on focus.
General IME considerations
Here are some things to consider when implementing IME for Wear:
- Set a default action.
RemoteInput
and Wear OS apps expect only single-line text entry. Always use the Enter key to trigger a call
to
sendDefaultEditorAction
,
which causes the app to dismiss the keyboard and continue on to the next step or action.
- Use a full-screen-mode IME.
Input methods on Wear OS cover most of the screen, leaving very little of the
app visible. Using full-screen mode offers an optimal user experience regardless of the
app UI. In full-screen mode, an
ExtractedText
provides a mirrored view of the text field being edited and can be styled to blend with the
rest of the input method UI. For more details on full-screen mode, see
InputMethodService
.
- Handle
InputType
flags.
At a minimum, for privacy reasons, handle the
InputType
flag TYPE_TEXT_VARIATION_PASSWORD
in your IME. When your IME is in
password mode, make sure that your keyboard is optimized for single key press,
meaning that auto spelling correction, auto completion, and gesture input are disabled.
Most importantly, the keyboard in password mode must support American Standard Code for Information Interchange (ASCII) symbols
regardless of the input language. For more details, see
Specify the input method type.
- Provide a key for switching to the next input method.
Android lets users switch between all IMEs supported by the platform.
In your IME implementation, set the boolean
supportsSwitchingToNextInputMethod
to true
.
This lets your IME support the switching mechanism so that apps can switch to the next
platform-supported IME. To learn more about how to implement switching between IMEs, see
Switching among IME subtypes.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-11-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-12 UTC."],[],[],null,["# Create input method editors on Wear\n\nWear OS supports input methods beyond voice by extending the\nAndroid input method editor (IME) framework. The IME framework provides support\nfor virtual, on-screen keyboards that let users input text in the form of\nkeyclicks, handwriting, or gestures.\n\n\nWear OS users can choose between various input options from Remote Input. These options include:\n\n- Dictation\n- Emoji\n- Canned responses\n- Smart Reply\n- Default IME\n\nCreate an input method for Wear\n\nThe Android platform provides a standard framework for creating IMEs. To create\na Wear-OS-specific IME, you need to optimize your IME for a wearable's limited screen size.\n\n### Wear-OS-specific IME filters\n\nTo learn how to create an input method for Wear OS, follow the guide to\n[create an input method](/guide/topics/text/creating-input-method) on handsets.\nThen add the Google Play filters in the following sections to your manifest file to make it a Wear-OS-specific IME.\n\n#### API level\n\nIf you are developing an IME for Wear OS, remember that the\nfeature is supported only on Android 6.0 (API level 23) and higher.\nTo ensure that your IME can be installed only on wearables that support input\nmethods beyond voice, add the following to your app's manifest: \n\n```xml\n\u003cuses-sdk android:minSdkVersion=\"23\" /\u003e\n```\n\n#### Device feature sets\n\nTo control how your app is filtered from devices that don't support\nWear OS IMEs, such as iPhones, add the following to your app's manifest: \n\n```xml\n\u003cuses-feature android:required=\"true\" android:name=\"android.hardware.type.watch\" /\u003e\n```\n\nInvoke an input method\n----------------------\n\nWear OS provides user settings on the watch that let the user enable multiple\nIMEs from the list of installed IMEs. Once the user enables your IME, they\ncan invoke your IME from the following places:\n\n- A notification or an app using the [RemoteInput](/reference/androidx/core/app/RemoteInput) API.\n- Wear OS apps with an [`EditText`](/reference/android/widget/EditText) field. Touching a text field places the cursor in the field and automatically displays the IME on focus.\n\nGeneral IME considerations\n--------------------------\n\nHere are some things to consider when implementing IME for Wear:\n\n- **Set a default action.**\n\n\n [`RemoteInput`](/reference/androidx/core/app/RemoteInput)\n and Wear OS apps expect only single-line text entry. Always use the \u003ckbd\u003eEnter\u003c/kbd\u003e key to trigger a call\n to\n [`sendDefaultEditorAction`](/reference/android/inputmethodservice/InputMethodService#sendDefaultEditorAction(boolean)),\n which causes the app to dismiss the keyboard and continue on to the next step or action.\n- **Use a full-screen-mode IME.**\n\n Input methods on Wear OS cover most of the screen, leaving very little of the\n app visible. Using full-screen mode offers an optimal user experience regardless of the\n app UI. In full-screen mode, an\n [`ExtractedText`](/reference/android/view/inputmethod/ExtractedText)\n provides a mirrored view of the text field being edited and can be styled to blend with the\n rest of the input method UI. For more details on full-screen mode, see\n [`InputMethodService`](/reference/android/inputmethodservice/InputMethodService).\n- **Handle `InputType` flags.**\n\n At a minimum, for privacy reasons, handle the\n [`InputType`](/reference/android/text/InputType)\n flag `TYPE_TEXT_VARIATION_PASSWORD` in your IME. When your IME is in\n password mode, make sure that your keyboard is optimized for single key press,\n meaning that auto spelling correction, auto completion, and gesture input are disabled.\n Most importantly, the keyboard in password mode must support American Standard Code for Information Interchange (ASCII) symbols\n regardless of the input language. For more details, see\n [Specify the input method type](/training/keyboard-input/style).\n- **Provide a key for switching to the next input method.**\n\n Android lets users switch between all IMEs supported by the platform.\n In your IME implementation, set the boolean\n [`supportsSwitchingToNextInputMethod`](/guide/topics/text/creating-input-method#Switching) to `true`.\n This lets your IME support the switching mechanism so that apps can switch to the next\n platform-supported IME. To learn more about how to implement switching between IMEs, see\n [Switching among IME subtypes](/guide/topics/text/creating-input-method#Switching)."]]