well there is two solution ,
if you want to do this fully automaized you need to get access to control the mobile keybored , if you have access you will be doing this automaticly , through this code
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
other wise you can switch him to the setting keybored profile through this code
InputMethodManager imeManager =
(InputMethodManager)
getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);
imeManager.showInputMethodPicker();
here is some function which can help you with your application development to deal with the keyboreds setup :
**//get the old default keyboard in case you want to**
use it later, or keep it enabled
String oldDefaultKeyboard =
Settings.Secure.getString(resolver,
Setting.Secure.DEFAULT_INPUT_METHOD);
**//enable your keyboard without user permission**
Settings.Secure.putString(resolver,
Settings.Secure.ENABLED_INPUT_METHODS,
"com.my.keyboard/.full.path");
**//set your keyboard as the new default keyboard without user permission**
Settings.Secure.putString(resolver,
Settings.Secure.DEFAULT_INPUT_METHOD,
"com.my.keyboard/.full.path");
//restore the keybored to default setting back through this code
@Override
public void onConfigurationChanged(Configuration newConfig) {
int currentKeyboard = 0;
boolean isShifted = kv.isShifted();
for (int i = 0; i < keyboard.length; i++) {
if(kv.getKeyboard().equals(keyboard[i])){
currentKeyboard = i;
break;
}
}
super.onConfigurationChanged(newConfig);
initializeKeyboardArray();
setKeyboard(keyboard[currentKeyboard]);
kv.setShifted(isShifted);
}
private void initializeKeyboardArray(){
keyboard = new Keyboard[7];
keyboard[ARABIC] = arabic;
keyboard[ARABIC_SHIFT] = arabicShift;
keyboard[ARABIC_SYMBOLS] = arabicSymbols;
keyboard[ARABIC_SYMBOLS_SHIFT] = arabicSymbolsShift;
keyboard[QWERTY] = qwerty;
keyboard[QWERTY_SYMBOLS] = qwertySymbols;
keyboard[QWERTY_SYMBOLS_SHIFT] = qwertySymbolsShift;
}