android输入法问题

本文介绍了如何修改Android系统的默认输入法,详细讲解了通过adb remount和编辑系统文件实现,默认输入法的设置方法,以及如何将拉丁输入法的'Done'按钮更改为'OK'的操作步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 谷歌输入法

 

  包名:com.google.android.inputmethod.latin

  属于第三方输入法

 

LatinIME软键盘

OpenWnn CJK输入法

PinyinIME GOOGLE输入法

 

2 修改系统默认输入法

打开输入法,点击默认的输入法:例如谷歌输入法。然后adb remount,打开eclipse,查看相应的数据库,导出数据库,查看数据库内容。

 



frameworks\base\packages\SettingsProvider\res\values\strings_add.xml

<!-- E40_Ewis input method --> 

<stringname="jsr_ewis_enabled_input_methods">com.android.inputmethod.latin/.LatinIME:com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME:com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService</string> 

<stringname="jsr_ewis_default_input_method">com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME</string>

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值