How to show soft keyboard on Android Things?

后端 未结 2 1497
無奈伤痛
無奈伤痛 2020-12-09 22:29

I\'m trying to show soft keyboard on Android Things, Raspberry Pi 3. I tried the methods below, but not succeeded so far:



        
相关标签:
2条回答
  • 2020-12-09 22:51

    By default, keybord apps are not installed on AT Developer Preview. You have to install it. See software keyboard.

    0 讨论(0)
  • 2020-12-09 23:13

    Update II: there is a bug with Dev Preview 5.1 when Google's soft keyboard doesn't show up at all.

    Update: starting with Dev Preview 4 the Android Things image is shipped with com.google.android.inputmethod.latin preinstalled. If you're going to use a 3d party keyboard app the approach below is still valid.


    You should enable the IME in Android Things Developer Preview in order for it to show up. Let's consider Google Keyboard as an example (since it worked for you). Once the keyboard has been installed and you shell-ed in (with adb shell) the following options might be used:


    Command line solution

    • Find out the IME ID

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

      Android Things 0.5+ (you might 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'd like to use the IME "app-wide" (not "system-wide"), use ime set ID instead of ime enable ID.


    Settings app solution

    Android Things 0.5+:

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

    Languages & Input -> Virtual keyboard -> Manage keyboards and enable the IME (should already be enabled)

    Android Things 0.1 - 0.4:

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

    Virtual keyboard -> Manage keyboards and enable the IME

    Note: In order to close _Android_'s settings app from within shell you can emulate a back button press multiple times with input keyevent 4 or force close the app with am force-stop com.android.settings.

    0 讨论(0)
提交回复
热议问题