Is there a way to restrict the Android soft keyboard to allow ONLY emoji characters?

Viewed 238

I have an EditText that can ONLY be a SINGLE Emoji character. I've added code and a filter to ensure this, but I still have a usability problem because the keyboard pops up in NORMAL text mode. It's not obvious to the user that only an Emoji character is allowed.

  <EditText
    android:id="@+id/activity_emoji"
    style="@style/Material.Widget.EditText.Light"
    android:layout_width="30dp"
    android:layout_height="wrap_content"
    android:textColor="#FF000000"
    android:text=""
    android:clickable="true"
    android:focusable="true"
    android:focusableInTouchMode="true" />

Ideally I could disable all input except Emoji, but that appears to be impossible. Another option would be to have the keyboard pop up already on the Emoji page instead of on the normal alphabet. Is it possible to do that, and if so how?

Seems to me the simple solution would be supporting:

android:inputType="Emoji"
1 Answers

I've added code and a filter to ensure this

Since there is no requirement for an input method editor to offer emoji, you have a slight problem.

I still have a usability problem because the keyboard pops up in NORMAL text mode

Many input method editors only have what you consider to be normal text mode.

Please understand that there are over 26,000 Android device models. These ship with dozens, if not hundreds, of pre-installed keyboards. Users can also install others from the Play Store, F-Droid, and elsewhere. None have to offer emoji. I would expect that relatively few do, though the ones that do (like GBoard) will be the most widely-used ones.

Also, please bear in mind that not all Android devices use soft keyboards. Sometimes, that's a fairly permanent state (e.g., Chromebooks). Sometimes, it is a temporary state (Bluetooth keyboard enabled, USB keyboard plugged in, other assistive device attached).

Is it possible to do that, and if so how?

No, sorry.

Related