Android sets the Default Input Method

Source: Internet
Author: User

Set Default Input Method

Add an attribute in frameworks/base/CORE/RES/values/config. xml:

<! -- Leo add -->

<String name = "config_default_input_method"> com. Android. inputmethod. Pinyin/. pinyinime </string>

 

 

Frameworks/base/services/Java/COM/Android/Server/inputmethodmanagerservice. Java

Buildinputmethodlistlocked ()
Add:

String defaultime = settings. Secure. getstring (mcontext

. Getcontentresolver (), settings. Secure. default_input_method );

// Leo

If (defaultime = NULL)

{

Final resources res = mcontext. getresources ();

Try

{

// Frameworks/base/CORE/RES/values/config. xml

String myime = res. getstring (COM. Android. Internal. R. String. config_default_input_method );

If (myime! = NULL & myime. Length ()> 0)

{

Settings. Secure. putstring (mcontext. getcontentresolver (),

Settings. Secure. default_input_method,

Myime );

}

}

Catch (exception E)

{

}

 

}

Http://hi.baidu.com/wishwingliao/blog/item/65a2d03f7dde8dd17d1e71ec.html

Or
Frameworks/base/services/Java/COM/Android/Server/inputmethodmanagerservice. Java

Buildinputmethodlistlocked ()
Add:

Static final string default_ime_id = "com. guobi. gbime/. gbime ";

String defaultime = settings. Secure. getstring (mcontext
. Getcontentresolver (), settings. Secure. default_input_method );

// Set default IME as gbime
If (defaultime = NULL ){
Settings. Secure. putstring (mcontext. getcontentresolver (),
Settings. Secure. default_input_method, default_ime_id );
}


Defaultime = settings. Secure. getstring (mcontext
. Getcontentresolver (), settings. Secure. default_input_method );

The third-party software of guopen has no source code. The path is in the vendor/apkvendors/IME/guobi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.