change the default android keyboard using ADB or java code

I am building a custom application that uses specific keyboard so when the user run the application, the default keyboard should be changed to my specific keyboard which name is hackers keyboard , How can I do that using java code or by calling adb command from java code , my device is rooted , again this is specific app and the company that I developing for require that.

Upvotes: 21

Views: 15026

Answers (2)

auselen
auselen

Reputation: 28087

You can use the ime command to set input method.

$ adb shell ime
usage: ime list [-a] [-s]
       ime enable ID
       ime disable ID
       ime set ID

Upvotes: 41

wiizzard
wiizzard

Reputation: 152

You could use KeyboardView in your application to open your own Keyboard. Therefore you should overwrite OnTouchListener of for example the edit textbox.

There is no need to have a rooted device nor to use adb. There is also an example in the Android SDK. It is called "SoftKeyboard".

Or you could have a look for an example on this blog post.

Upvotes: 2

Related Questions