How to show a soft keyboard on Android Things?

I am trying to show a soft keyboard on Android Things, Raspberry Pi 3. I have tried the methods below, but have failed so far:

<activity ... android:windowSoftInputMode="stateAlwaysVisible"> 

and

 <EditText ... android:inputType="numberDecimal"/> 

Does Android Things 7.0 support a soft keyboard, or am I missing something?

+6
source share
2 answers

Update II : an error occurs with Dev Preview 5.1 when the Google soft keyboard does not appear at all .

Update : Starting with Dev Preview 4, the Android Things image comes preloaded with com.google.android.inputmethod.latin . If you intend to use the app for a 3D party, then the approach is still valid.


You must enable IME in the Android Things Developer Preview for it to appear. Consider the Google Keyboard example as an example (since it worked for you). After the keyboard is installed and you are shell -ed in (with adb shell ), you can use the following options:


Command line solution

  • Find out the IME ID

     $ ime list -a | grep mId 
  • Enable IME using fully qualified mId

    Android Things 0.5+ (you can get already enabled )

     $ ime enable com.android.inputmethod.latin/.LatinIME 

    Android Things 0.1 - 0.4:

     $ ime enable com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME 

Note. If you want to use the IME "application" (not the "system-wide"), use the ime set ID instead of the ime enable ID .


Application settings

Android Things 0.5 +:

  am start -n com.android.settings/.Settings\$SystemDashboardActivity 

Languages & InputVirtual keyboardManage keyboards and enable IME (must be enabled)

Android Things 0.1 - 0.4:

  am start -n com.android.settings/.Settings\$InputMethodAndLanguageSettingsActivity 

Virtual keyboardManage keyboards and enable IME

Note. To close the _Android_ settings application from the shell , you can emulate the back button several times using input keyevent 4 or force closing the application using am force-stop com.android.settings .

+3
source

By default, Keybord applications are not installed in the developer preview. You must install it. See soft keyboard .

+2
source

Source: https://habr.com/ru/post/1014663/


All Articles