开发板Android11修改第三方输入法为默认输入法
<div class='showpostmsg'><p data-track="22"><strong>一、安装输入法并查看输入法包名</strong></p><p data-track="5"> </p>
<p data-track="18">本次要安装的是百度输入法,安装方法如下:</p>
<p> </p>
<p data-track="2">1.1 adb命令行方式安装</p>
<p data-track="3"> </p>
<p>电脑键盘通过win+R组合键弹出输入框,输入cmd进入电脑终端,并执行以下命令:</p>
<pre>
<code>#查看是否识别到adb设备
adb.exe devices
#让系统获取root权限
adb.exe root#
让系统可读可写
adb.exe remount#
开始安装
adb.exe install /your/target/path/baidu.apk</code></pre>
<p> </p>
<p> </p>
<p data-track="29">1.2 U盘/TF卡安装</p>
<p data-track="9"> </p>
<p>将输入法apk放置U盘/TF内,插入主板识别到设备后,进入系统桌面找到【资源管理器】应用,点击U盘输入法apk应用安装即可。</p>
<p> </p>
<p data-track="12"> </p>
<p data-track="13">安装成功</p>
<p> </p>
<p> </p>
<p data-track="30">1.3 查看输入法包名</p>
<pre>
<code># ime list -s
com.baidu.input/.ImeService</code></pre>
<p>输出的结果就是该输入法的包名/类名。</p>
<p> </p>
<p data-track="23"><strong>二、系统预安装输入法应用</strong></p>
<p> </p>
<p>将需要预安装的百度输入法APK放置<br />
device/rockchip/rk356x/rk3566_r/preinstall_del/目录下</p>
<p>(没有preinstall_del目录就手动创建一个即可),并添加以下文件:</p>
<ul>
<li>Android.mk</li>
<li>baidu.apk(APK)</li>
<li>preinstall.mk</li>
</ul>
<p> </p>
<p>Android.mk文件内容:</p>
<pre>
<code>include $(call all-subdir-makefiles)</code></pre>
<p>preinstall.mk文件内容:</p>
<pre>
<code>PRODUCT_PACKAGES += baidu</code></pre>
<p>注意:baidu为APK名字,例如baidu.apk。</p>
<p> </p>
<p data-track="24"><strong>三、修改输入法环境变量</strong></p>
<p>将前面第一步获取到的百度输入法包名/类名添加到以下文件:</p>
<pre>
<code>frameworks/base/packages/SettingsProvider/res/values/defaults.xml</code></pre>
<p>内容如下:</p>
<pre>
<code><!-- should show the screenshot button default -->
<integer name="def_screenshot_button_show">0</integer>
+ <!-- set default input method-->
+ <string name="config_default_input_method" translatable="false">com.baidu.input/.ImeService</string>
</resources></code></pre>
<p> </p>
<p data-track="25"><strong>四、修改默认输入法</strong></p>
<p data-track="26"> </p>
<p data-track="27">将前面输入法环境添加到以下文件:</p>
<pre>
<code>frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java</code></pre>
<p>添加内容如下:</p>
<pre>
<code>class DatabaseHelper extends SQLiteOpenHelper {
loadIntegerSetting(stmt, Settings.Secure.SLEEP_TIMEOUT,
R.integer.def_sleep_timeout);
+ loadStringSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD, R.string.config_default_input_method);//add hjt
/*
* IMPORTANT: Do not add any more upgrade steps here as the global,
* secure, and system settings are no longer stored in a database</code></pre>
<p>添加完重新编译源码即可。</p>
<p> </p>
<p data-track="28"><strong>五、查看百度输入法是否为默认输入法</strong></p>
<p>命令行</p>
<pre>
<code># settings get secure default_input_method
com.baidu.input/.ImeService</code></pre>
<p>设置默认输入法成功</p>
<p> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>
页:
[1]