First, applicable to ICS (Android V4.0) before the version:
1. Install the default input method (. apk) required to System/app
2. Modify File Frameworks/base/packages/settingsprovider/res/values/defaults.xml
Default Input Method ID
A red flag indicates an input method ID, such as Pinyinime: com.android.inputmethod.pinyin/. Pinyinime
Second, applicable to ICS, JB, JB2 and after the version:
1. The default Input method (. apk) that needs to be used in advance will be built into the system (please refer to how to preset the APK into the system)
2. Modify File Mediatek/config/${project}/projectconfig.mk
Set the value of the macro Default_input_method to the desired input method;
such as Pinyinime, then set to: Default_input_method = Com.android.inputmethod.pinyin.PinyinIME
This value is the source of the input method, which contains the name of the Inputmethodservice subclass. The class name of the subclass that implements the Inputmethodservice. Here is one less "/" than the full class name printed in log, please note
Supplementary Note:
The above modification method only applies to the default input method of com.android.inputmethod.pinyin/. Pinyinime This format input method (that is, after the backslash is the case of the class name),
For Com.google.andr
Oid.inputmethod.latin/com.android.inputmethod.latin.latinime (that is, the case of the full class name after the backslash),
This situation is not supported by modifying MEDIATEK/CONFIG/${PROJECT}/PROJECTCONFIG.MK
Inside the Default_input_method method to set the default input method.
With Com.google.andr
Oid.inputmethod.latin/com.android.inputmethod.latin.latinime as an example
Use the following method to modify, in the Databasehelper.java of Settingsprovider
Yes
LOG.I (TAG, "defaultime:" + defaultime);
if (defaultime!= null) {
StringBuffer strbuffer = new StringBuffer (defaultime);
int lastdotpos = Defaultime.lastindexof (".");
String Strinsert = "/";
Strbuffer.insert (Lastdotpos, Strinsert);
Loadsetting (stmt, Settings.Secure.DEFAULT_INPUT_METHOD,
Strbuffer.tostring ());
} else {
LOG.I (TAG, "default IME from Imefeatureoption is null!!");
}
Remove the default initialization part of the code, and then delete the following code.
LOG.I (TAG, "defaultime:" + defaultime);
if (defaultime!= null) {
StringBuffer strbuffer = new StringBuffer (defaultime);
int lastdotpos = Defaultime.lastindexof (".");
String Strinsert = "/";
Strbuffer.insert (Lastdotpos, Strinsert);
Loadsetting (stmt, Settings.Secure.DEFAULT_INPUT_METHOD,
Strbuffer.tostring ());
} else {
LOG.I (TAG, "default IME from Imefeatureoption is null!!");
}
Then add the following after the deletion
Loadsetting (stmt, Settings.Secure.ENABLED_INPUT_METHODS,
"Com.google.andr
Oid.inputmethod.latin/com.android.inputmethod.latin.latinime "); Here to fix this default enable Input method
Loadsetting (stmt, Settings.Secure.DEFAULT_INPUT_METHOD,
"Com.google.andr
Oid.inputmethod.latin/com.android.inputmethod.latin.latinime ")//here Modify the default selected Input method