Search code examples
javaandroidkeyboard

How to create an additional input method service without changing default selected one?


I want to make a new input method with no actual keyboard. It should stay active (after being enabled by user) always but not be the default keyboard. Because it will not have any visual keyboard and user will still be able to use the default keyboard as he/she selects.

I will trigger it on demand from a network command. Is this possible ? It should be possible, because for example Android TV remote or Shield TV remote can do this.

But I couldn't find how to do it. When I create a normal input method, it only works if I select it as the default input method.

    <service android:name="SoftKeyboard"
        android:permission="android.permission.BIND_INPUT_METHOD">
        <intent-filter>
            <action android:name="android.view.InputMethod" />
        </intent-filter>
        <meta-data android:name="android.view.im" android:resource="@xml/method" />
    </service>

This is the part from manifest file. Is it possible to make it work without selecting it as the default input method ? As a second, additional input method …


Solution

  • I could not find a solution which could live together with the original leanback keyboard. So, I found an example Leanback keyboard code , injected my rest API in it. Now I have the leanback keyboard modified to make what I want.