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 lets users 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.
You can specify the input method type for Android TV in exactly the same way as you do for mobile, except that Gboard for Android TV supports a more limited set of input types, shown in the following figures:
You can specify one or more input types based on your use case. Gboard automatically determines the best layout based on the input types you specify and the layouts it supports.
One major difference with Gboard for Android TV is the ability to specify where the keyboard should be placed. Previously, the keyboard covered the bottom portion of the screen from edge to edge, but an update to Gboard lets it float. You can specify where the keyboard should go: left, right, or center. The default position is in the center.
To control the alignment, set the value within
horizontalAlignment. The options for
horizontalAlignment are the default
This is shown in the following example:
<EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:imeOptions="actionNext" android:privateImeOptions="horizontalAlignment=right">
This example results in the keyboard being placed at the bottom right, which works well when you have input fields aligned to the right:
Gboard for Android TV supports many different languages. The list of languages includes the following: