前言
最近有看过别人定制输入法,也想看看怎么实现,因此看到《【Android输入法源码】基于GooglePinyin开源代码进行修改可运行!!!》就下载该作者上传代码调试了一下,可以运行,但不同设备还是存在bug。
PS: 本文摘抄,代码调试过,可以运行,存在不同设备适配问题。
正文
过程
找了非常多的网站,csdn也有,有一些根本没法用,eclipse不能,androidStudio的也不行,有的说可行但是没有告诉在什么环境下可行。很让人郁闷,通过努力终于可以正常运行,并做了细微调整。
修改部分
- gradle配置
- 部分源码丢失对象及参数补全
- 部分废弃代码更新
- Android.mk
- CMakeLists.txt
- 键盘按键高度及字号显示优化
- 增加跳转激活输入法
- 增加已激活输入法但不是默认弹出选择默认输入弹框
运行环境
- Android Studio 4.1.2
- CMake 3.6.4111459
- Gradle 6.5(AS要求) – 4.1.2 (配置)
- NDK 21.1.6352462
工程中builde.gradle(不是app中的哈)中的配置:
ext {
ndkVersion = '21.1.6352462'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google{ url 'https://maven.aliyun.com/repository/google'}
jcenter{ url 'https://maven.aliyun.com/repository/jcenter'}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
}
}
allprojects {
repositories {
google{ url 'https://maven.aliyun.com/repository/google'}
jcenter{ url 'https://maven.aliyun.com/repository/jcenter'}
}
}
代码下载
下面是原文作者上传的,我本地的还在调试,懒得上传啦。
Gitee
https://gitee.com/jabony/PinyinIME.git
CSDN
https://download.csdn.net/download/knockheart/11184164
参考文章
© 版权声明