来了就不要走啦

技术文档,源码分析

android系统ime指令

介绍几种android系统中ime的shell指令:
enable指定的输入法
root@kylin32:/data/anr # ime enable com.iflytek.inputmethod.gionee/.FlyIME     
Input method com.iflytek.inputmethod.gionee/.FlyIME: now enabled
列出输入法信息,只显示service名称
root@kylin32:/data/anr # ime list -s
com.android.inputmethod.latin/.LatinIME
com.example.android.softkeyboard/.SoftKeyboard
com.iflytek.inputmethod.gionee/.FlyIME
原理:
mImm.getEnabledInputMethodList(); // list -a
mImm.getInputMethodList(); // list -s

disable指定输入法
root@kylin32:/data/anr # ime disable com.iflytek.inputmethod.gionee/.FlyIME    
Input method com.iflytek.inputmethod.gionee/.FlyIME: now disabled
root@kylin32:/data/anr # ime list -s
com.android.inputmethod.latin/.LatinIME
com.example.android.softkeyboard/.SoftKeyboard
原理:
mImm.setInputMethodEnabled(id, state);

选择指定输入法用于输入
root@kylin32:/data/anr # ime set com.android.inputmethod.latin/.LatinIME       
Input method com.android.inputmethod.latin/.LatinIME selected
原理:
mImm.setInputMethod(null, id);

列出输入法所有信息
root@kylin32:/data/anr # ime list -a
com.android.inputmethod.latin/.LatinIME:
  mId=com.android.inputmethod.latin/.LatinIME mSettingsActivityName=com.android.inputmethod.latin.settings.SettingsActivity
  mIsDefaultResId=0x7f070000
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.android.inputmethod.latin.LatinIME
      packageName=com.android.inputmethod.latin
      labelRes=0x7f0a0037 nonLocalizedLabel=null icon=0x0 banner=0x0
      enabled=true exported=true processName=com.android.inputmethod.latin
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
com.iflytek.inputmethod.gionee/.FlyIME:
  mId=com.iflytek.inputmethod.gionee/.FlyIME mSettingsActivityName=com.iflytek.inputmethod.gionee.WizardSettingActivity
  mIsDefaultResId=0x0
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.iflytek.inputmethod.gionee.FlyIME
      packageName=com.iflytek.inputmethod.gionee
      enabled=true exported=true processName=com.iflytek.inputmethod.gionee
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
com.example.android.softkeyboard/.SoftKeyboard:
  mId=com.example.android.softkeyboard/.SoftKeyboard mSettingsActivityName=com.example.android.softkeyboard.ImePreferences
  mIsDefaultResId=0x0
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.example.android.softkeyboard.SoftKeyboard
      packageName=com.example.android.softkeyboard
      enabled=true exported=true processName=com.example.android.softkeyboard
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huilin9960/article/details/80694571
文章标签: inputmethod shell指令
个人分类: android
所属专栏: Android应用开发
想对作者说点什么? 我来说一句

PinyinIME.rar(内含PinyinIME.apk)

2011年09月20日 2.76MB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭