Google 致力于为黑人社区推动种族平等。查看具体举措

On-screen keyboard

Android TV comes with an on-screen software keyboard named Gboard. The keyboard supports a wide range of features including speech-to-text (STT), which allows users to speak and have the speech automatically translated into text for input. This feature works through Gboard, so you don't need to request the audio permission or do any special handling in your app.

Input methods

You can specify the input method type in exactly the same way for Android TV as you do for mobile, but Gboard for Android TV supports a more limited set of input types:

Email input
Email input
Password input
Password input
Text input
Text input
Numeric input
Numeric input

Similar to mobile, you can specify one or more input types based on your use case. Gboard will automatically determine the best layout based on the input type(s) you specify and the layouts it supports.

Placement

One major difference with Gboard for Android TV is the ability to specify where the keyboard should be placed. Traditionally, the keyboard covered the bottom portion of the screen from edge to edge, but an update to Gboard allows it to float. You can specify where the keyboard should go: left, right, or center (default).

Alignment of Gboard
Alignment options for Gboard

To control the alignment, set the value within privateImeOptions for horizontalAlignment. The options for horizontalAlignment are center (the default value), left, and right. For example:

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:imeOptions="actionNext"
    android:privateImeOptions="horizontalAlignment=right">

This results in the keyboard being placed at the bottom right, which works well when you have input fields aligned to the right like this:

Example alignment of Gboard
Example alignment of Gboard

Supported languages supported

Gboard for Android TV supports many different languages. The list of languages includes the following:

  • English (US)
  • English (Australia)
  • English (Canada)
  • English (UK)
  • Chinese (Simplified)
  • Chinese (Traditional)
  • Danish
  • Dutch
  • Finnish
  • French
  • French (Canada)
  • German
  • German (Austria)
  • German (Switzerland)
  • Hebrew
  • Hindi
  • Hindi (transliteration)
  • Italian
  • Italian (Switzerland)
  • Japanese (Japan)
  • Korean
  • Norwegian Bokmål
  • Russian
  • Spanish (Mexico)
  • Spanish (Spain)
  • Swedish
  • Vietnamese