admin管理员组文章数量:1562649
Android系统原生的拉丁输入法在很多情况下是无法满足我们的需求的,因此就需要开发者集成输入法,基础输入法到系统,并需要修改系统默认输入法的配置。
设置默认输入法:
代码路径:SettingsProvider/res/values/defaults.xml
在defaults.xml添加def_enabled_input_methods和def_input_method:
<string name="def_enabled_input_methods" translatable="false">com.android.inputmethod.pinyin/.PinyinIME</string>
<string name="def_input_method" translatable="false">com.android.inputmethod.pinyin/.PinyinIME</string>
代码路径:SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java
private void loadSecureSettings(SQLiteDatabase db) {
SQLiteStatement stmt = null;
try {
stmt = dbpileStatement("INSERT OR IGNORE INTO secure(name,value)"
+ " VALUES(?,?);");
...
...
...
//add
loadStringSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS,
R.string.def_enabled_input_methods);
loadStringSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD, R.string.def_input_method);
//add
/// M: Load MTK added Secure providers before Android M.
mUtils.loadCustomSecureSettings(stmt);
...
...
} finally {
if (stmt != null) stmt.close();
}
}
常见输入法大全:
QQ输入法:com.tencent.qqpinyin/.QQPYInputMethodService
搜狗输入法:com.sohu.inputmethod.sogou/.SogouIME
手心输入法:com.xinshuru.inputmethod/.FTInputService
百度输入法:com.baidu.input/.ImeService
讯飞输入法:com.iflytek.inputmethod/.FlyIME
谷歌拼音输入法:com.google.android.inputmethod.pinyin/.PinyinIME
触宝输入法:com.cootek.smartinput5/.TouchPalIME
系统默认(拉丁输入法):com.android.inputmethod.latin/.LatinIME
谷歌Gboard:com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
Go 输入法:com.jb.emoji.gokeyboard/com.jb.gokeyboard.GoKeyboard
SwiftKey Keyboard 输入法:com.touchtype.swiftkey/com.touchtype.KeyboardService
微软必应输入法:com.bingime.ime/.BingIme
版权声明:本文标题:Android设置默认输入法(附带常见输入法) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1727480760a1116797.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论