TuanVA
TuanVA

Reputation: 1

Create custom keyboard android which support vietnamese and english

I'm planning to create a custom soft keyboard on android which support two languages English and Vietnamese. I searched in internet a guideline to create a custom keyboard on android here: https://developer.android.com/guide/topics/text/creating-input-method.html. But I still don't know how to create a Vietnamese keyboard. In Vietnamese keyboard, there are some cases I need to handle: - Some keys when I double press, it becomes another key. Example:

A -> double press: Â
O -> double press: Ô
E -> double press: Ê
... 

How can I create keyboard_layout.xml for Vietnamese keyboard? And how can I handle Vietnamese keyboard in android java code in cases above?

Upvotes: 0

Views: 1275

Answers (1)

haresh
haresh

Reputation: 1420

Only way you can do with IME. See http://developer.android.com/guide/topics/text/creating-input-method.html.

<input-method xmlns:android="http://schemas.android.com/apk/res/android"
    android:settingsActivity="com.android.inputmethod.latin.SettingsActivity"
    android:isDefault="@bool/im_is_default">
<subtype android:icon="@drawable/ic_subtype_keyboard"
        android:label="@string/subtype_en_US"
        android:imeSubtypeLocale="en_US"
        android:imeSubtypeMode="keyboard"
      android:imeSubtypeExtraValue="TrySuppressingImeSwitcher,AsciiCapable,SupportTouchPositionCorrection"
/>

  <subtype android:icon="@drawable/ic_subtype_keyboard"
        android:label="@string/subtype_generic"
        android:imeSubtypeLocale="vi"
        android:imeSubtypeMode="keyboard"
        android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable"
/>

Upvotes: 0

Related Questions