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