做傳感器的網(wǎng)站跨境電商平臺(tái)有哪些?
1.問題場景
由于系統(tǒng)自帶的Latin輸入法不支持遙控器操作,需要替換為RK的拼音輸入法。
2. 替換步驟
1)將LatinIME從mk中刪除,讓系統(tǒng)編譯的時(shí)候不編譯該apk
--- a/Android/build/make/target/product/handheld_product.mk
+++ b/Android/build/make/target/product/handheld_product.mk
@@ -23,7 +23,6 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/media_product.mk)# /product packagesPRODUCT_PACKAGES += \Browser2 \
- LatinIME \preinstalled-packages-platform-handheld-product.xml \SettingsIntelligence \frameworks-base-overlays
2)添加PinyinIME的編譯預(yù)裝
--- a/Android/device/rockchip/common/modules/rockchip_apps.mk
+++ b/Android/device/rockchip/common/modules/rockchip_apps.mk
@@ -20,3 +20,5 @@# RkVideoPlayer \# RkExplorer \# StressTest
+PRODUCT_PACKAGES += \
+ PinyinIME
3)設(shè)置PinyinIME為默認(rèn)輸入法。這一步在網(wǎng)上搜了幾個(gè)方案 ,但是都有些問題,后面自己試驗(yàn)用如下方式可以設(shè)置成功,即在InputManagerServices.java的buildInputMethodListLocked函數(shù)中添加設(shè)置默認(rèn)輸入法值的動(dòng)作
+++ b/Android/frameworks/base/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -4560,6 +4560,26 @@ public class InputMethodManagerService extends IInputMethodManager.StubSlog.e(TAG, "buildInputMethodListLocked is not allowed until system is ready");return;}
+ String defaultIme = Settings.Secure.getString(mContext
+ .getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
+ if ( defaultIme == null ) {
+ final Resources res = mContext.getResources();
+ try{
+ String myIME = "com.android.inputmethod.pinyin/.PinyinIME";
+ if ( myIME != null && myIME.length() > 0 )
+ {
+ Settings.Secure.putString( mContext.getContentResolver(),
+ Settings.Secure.DEFAULT_INPUT_METHOD,
+ myIME );
+ Settings.Secure.putString( mContext.getContentResolver(),
+ Settings.Secure.ENABLED_INPUT_METHODS,
+ myIME );
+ }
+ } catch( Exception e ) {
+ }
+ }