Handle keyboard input
Stay organized with collections
Save and categorize content based on your preferences.
Try the Compose way
Jetpack Compose is the recommended UI toolkit for Android. Learn about touch and input in Compose.
The Android system shows an on-screen keyboard—known as a
soft input method—when a text field in your UI receives focus.
To provide the best user experience, you can specify characteristics
about the type of input you expect, such as a
phone number or email address, and how the input method must behave, such as
performing autocorrect for spelling mistakes.
In addition to the on-screen input methods, Android supports hardware keyboards, so it's
also important to optimize your app to support attached keyboards.
These topics and more are discussed in the following documentation.
Lessons
- Specify the input method type
- Learn how to show certain soft input methods, such as those designed for phone numbers, web
addresses, or other formats. Also, learn how to specify characteristics such
as spelling suggestion behavior and action buttons such as Done or Next.
- Handle input method visibility
- Learn how to specify when to show the soft input method and how
your layout must adjust to the reduced screen space.
- Support keyboard navigation
- Learn how to verify that users can navigate your app using a keyboard
and how to make any necessary changes to the navigation order.
- Handle keyboard actions
- Learn how to respond directly to keyboard input for user actions.
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 2025-05-20 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 2025-05-20 UTC."],[],[],null,["# Handle keyboard input\n\nTry the Compose way \nJetpack Compose is the recommended UI toolkit for Android. Learn about touch and input in Compose. \n[Touch and input →](/develop/ui/compose/touch-input) \n\nThe Android system shows an on-screen keyboard---known as a\n*soft input method*---when a text field in your UI receives focus.\nTo provide the best user experience, you can specify characteristics\nabout the type of input you expect, such as a\nphone number or email address, and how the input method must behave, such as\nperforming autocorrect for spelling mistakes.\n\nIn addition to the on-screen input methods, Android supports hardware keyboards, so it's\nalso important to optimize your app to support attached keyboards.\n\nThese topics and more are discussed in the following documentation.\n\nLessons\n-------\n\n**[Specify the input method type](/develop/ui/views/touch-and-input/keyboard-input/style)**\n: Learn how to show certain soft input methods, such as those designed for phone numbers, web\n addresses, or other formats. Also, learn how to specify characteristics such\n as spelling suggestion behavior and action buttons such as **Done** or **Next**.\n\n**[Handle input method visibility](/develop/ui/views/touch-and-input/keyboard-input/visibility)**\n: Learn how to specify when to show the soft input method and how\n your layout must adjust to the reduced screen space.\n\n**[Support keyboard navigation](/develop/ui/views/touch-and-input/keyboard-input/navigation)**\n: Learn how to verify that users can navigate your app using a keyboard\n and how to make any necessary changes to the navigation order.\n\n**[Handle keyboard actions](/develop/ui/views/touch-and-input/keyboard-input/commands)**\n: Learn how to respond directly to keyboard input for user actions."]]