1 谷歌输入法
包名:com.google.android.inputmethod.latin
属于第三方输入法
LatinIME软键盘
OpenWnn CJK输入法
PinyinIME GOOGLE输入法
2 修改系统默认输入法
打开输入法,点击默认的输入法:例如谷歌输入法。然后adb remount,打开eclipse,查看相应的数据库,导出数据库,查看数据库内容。
frameworks\base\packages\SettingsProvider\res\values\strings_add.xml
frameworks\base\packages\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java
loadSecureSettings()方法中:
/*Begin add by liting in 20160122 makedefault input_method for E43_Ewis */
if (JSRConfig.J_E43_Ewis){
loadStringSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS,
R.string.jsr_ewis_enabled_input_methods);
loadStringSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD,
R.string.jsr_ewis_default_input_method);
}
/*End add by liting in 20160122 make defaultinput_method for E43_Ewis */
第二种方式:
在\frameworks\base\services\java\com\android\server的InputMethodManagerService.java文件里面buildInputMethodListLocked()方法添加以下内容:
String defaultIme =
Settings.Secure.getString(mContext.getContentResolver(),Settings.Secure.DEFAULT_INPUT_METHOD);
if(defaultIme== null){
finalResources res = mContext.getResources();
try{
//StringmyIME =
res.getString(com.android.internal.R.string.config_default_input_method1);
StringmyIME = "com.klye.ime.latin/.LatinIME";
if(myIME!=null&&myIME.length()>0){
Settings.Secure.putString(mContext.getContentResolver(),
Settings.Secure.DEFAULT_INPUT_METHOD,myIME);
}
}catch(Exceptione){
}
}
该方法加载输入法列表,读取器用的输入法,如果设置为空,加载全部输入法,并选择一个默认输入法。
3 将Latinime输入法的某“Done”字符变为“OK”
\packages\inputmethods\LatinIME
经分析,所有按键都是画出来的。暂时的修改方法是:
\packages\inputmethods\LatinIME\java\src\com\android\inputmethod\keyboard\KeyboardView.java
//finalString label = key.getLabel();
//beginmodify by liting in 2016-1-28
String keylabel = key.getLabel();
if(("Done").equals(keylabel)){
final String locale = context.getResources().getConfiguration().locale.getCountry();
if(("CZ").equals(locale)){
keylabel = "OK";
}
}
final String label = keylabel;
//end modify by liting in 2016-1-28
com.android.inputmethod.latin/.LatinIME:com.cootek.smartinputv5.oem/com.cootek.smartinput5.TouchPalIME:com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService:com.android.inputmethod.pinyin/.PinyinIME:com.klye.ime.latin/.LatinIME
com.android.inputmethod.latin/.LatinIME:com.android.inputmethod.pinyin/.PinyinIME:com.cootek.smartinputv5.oem/com.cootek.smartinput5.TouchPalIME:com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService