13

I have developed one android keyboard. It's working properly as separate app on any device. Now I need to show my app in:

(Setting->Input)

Below image shows external keyboard added in device:

enter image description here

As you see in image Android keyboard is default.

Example: Swiftkey 3 is added externally.

But I don't know how to add my own keyboard so I can choose this?

CKE
  • 1,533
  • 19
  • 18
  • 29
Aniket
  • 2,204
  • 5
  • 34
  • 51
  • "Its working properly as separate app on any device" -- what does this mean? Did you implement an `InputMethodEditor` and `InputMethodService`? – CommonsWare Jul 08 '13 at 15:15
  • No i didn't i have tried using reference as given below but getting some problem.. – Aniket Jul 08 '13 at 15:18
  • @CommonsWare i added InputMethod it showing my keyboard option in settings as shown in above image but when i want to replace my custom keyboard with built in device keyboard it gives me error.... – Aniket Oct 12 '13 at 05:50

2 Answers2

9

You should first take a look here. Then continue with this thread here, as stated there:

Some tips:

An inputMethod is basically an Android Service, so yes, you can do HTTP and all the stuff you can do in a Service.

You can open Activities and dialogs from the InputMethod. Once again, it's just a Service.

Here's another tutorial on the topic. I hope all this is helpful for you.

Cheers

Community
  • 1
  • 1
g00dy
  • 6,752
  • 2
  • 30
  • 43
  • i have already used this reference but not getting solution, have you successfully implemented this help so your keyboard will be running from Settings, not as separate app. – Aniket Jul 08 '13 at 14:52
  • Which reference did you use? Did you take a look at the tutorial below ? – g00dy Jul 08 '13 at 15:11
  • @Aniket - and this problem is ? – g00dy Oct 11 '13 at 12:54
  • it is working without any error on emulator, and also if i run my app using apk file on any remote android device it is running successfully, but you know my app is no more user app it has to work as system app by replacing in-built keyboard, thats why ,i have only changed my android Menifest.xml file noting else...... – Aniket Oct 11 '13 at 13:05
4

You have to create InputMethodService... and just add below code in Menifest.xml file

<service android:name="FastInputIME"
        android:label="@string/fast_input_label"
        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>

Permisson:

<uses-permission android:name="android.permission.BIND_INPUT_METHOD"/>
Niranj Patel
  • 32,980
  • 10
  • 97
  • 133
  • Hi @CapDroid i have used xml configuration as you told above, so my app is successfully showing in settings option in android device, but when i want to switch from android default keyboard to my custom keyboard i am getting error like this "Unfortunately MyKeyboard has stopped". Do you have any about this? I have already posted my problem in detail on SO but not getting any response...please help me..... – Aniket Oct 11 '13 at 06:49
  • @Aniket its means something error in your application.. check logcat error. – Niranj Patel Oct 11 '13 at 07:12
  • you know @CapDroid now my app in system app working on remote android device so how can i check logcat.... – Aniket Oct 11 '13 at 07:48
  • yes i have checked it is working properly on my emulator as well as on device after changed code..... – Aniket Oct 11 '13 at 10:58
  • permission is not necessary – Zar E Ahmer Dec 16 '14 at 11:53