简单适用于学习的安卓输入法代码,要用android studio打开
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-26 17:47 PinyinIME
目录 0 2012-01-10 16:19 PinyinIME
es
目录 0 2012-01-10 16:19 PinyinIME
esdrawable
文件 424 2011-11-15 13:22 PinyinIME
esdrawablespace_icon.png
目录 0 2018-08-04 13:38 __MACOSX
目录 0 2018-08-04 13:38 __MACOSXPinyinIME
目录 0 2018-08-04 13:38 __MACOSXPinyinIME
es
目录 0 2018-08-04 13:38 __MACOSXPinyinIME
esdrawable
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._space_icon.png
文件 365 2011-11-15 13:22 PinyinIME
esdrawablearrow_right.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._arrow_right.png
文件 534 2011-11-15 13:22 PinyinIME
esdrawableemotion_icon_12_popup.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._emotion_icon_12_popup.png
文件 908 2011-11-15 13:22 PinyinIME
esdrawableime_en.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._ime_en.png
文件 492 2011-11-15 13:22 PinyinIME
esdrawableemotion_icon_06_popup.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._emotion_icon_06_popup.png
文件 954 2011-11-15 13:22 PinyinIME
esdrawable
umstar.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._numstar.png
文件 1017 2011-11-15 13:22 PinyinIME
esdrawableshift_off_icon.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._shift_off_icon.png
文件 151 2011-11-15 13:22 PinyinIME
esdrawablecands_container_bg.9.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._cands_container_bg.9.png
文件 593 2011-11-15 13:22 PinyinIME
esdrawablecandidate_balloon_bg.9.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._candidate_balloon_bg.9.png
文件 226 2011-11-15 13:22 PinyinIME
esdrawablecomma_full_popup_icon.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._comma_full_popup_icon.png
文件 128 2011-11-15 13:22 PinyinIME
esdrawableskb_bg.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._skb_bg.png
文件 229 2011-11-15 13:22 PinyinIME
esdrawableemotion_icon_14_popup.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._emotion_icon_14_popup.png
............此处省略455个文件信息
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include
#include
#include
#include
#include
#include
#include “../include/pinyinime.h“
#include “../include/sync.h“
#include “../include/userdict.h“
#ifdef __cplusplus
extern “C“ {
#endif
using namespace ime_pinyin;
#define RET_BUF_LEN 256
static char16 retbuf[RET_BUF_LEN];
static char16 (*predict_buf)[kMaxPredictSize + 1] = NULL;
static size_t predict_len;
static Sync sync_worker;
static struct file_descriptor_offsets_t
{
jclass mClass;
jfieldID mDescriptor;
} gFileDescriptorOffsets;
JNIEXPORT jboolean JNICALL nativeImOpenDecoder(JNIEnv* env jclass jclazz
jbyteArray fn_sys_dict
jbyteArray fn_usr_dict) {
jbyte *fsd = (*env).GetByteArrayElements(fn_sys_dict 0);
jbyte *fud = (*env).GetByteArrayElements(fn_usr_dict 0);
jboolean jret = JNI_FALSE;
if (im_open_decoder((const char*)fsd (const char*)fud))
jret = JNI_TRUE;
(*env).ReleaseByteArrayElements(fn_sys_dict fsd 0);
(*env).ReleaseByteArrayElements(fn_usr_dict fud 0);
return jret;
}
JNIEXPORT jboolean JNICALL nativeImOpenDecoderFd(JNIEnv* env jclass jclazz
jobject fd_sys_dict
jlong startoffset
jlong length
jbyteArray fn_usr_dict) {
jint fd = env->GetIntField(fd_sys_dict gFileDescriptorOffsets.mDescriptor);
jbyte *fud = (*env).GetByteArrayElements(fn_usr_dict 0);
jboolean jret = JNI_FALSE;
int newfd = dup(fd);
if (im_open_decoder_fd(newfd startoffset length (const char*)fud))
jret = JNI_TRUE;
close(newfd);
(*env).ReleaseByteArrayElements(fn_usr_dict fud 0);
return jret;
}
JNIEXPORT void JNICALL nativeImSetMaxLens(JNIEnv* env jclass jclazz
jint max_sps_len
jint max_hzs_len) {
im_set_max_lens(static_cast(max_sps_len)
static_cast(max_hzs_len));
return;
}
JNIEXPORT jboolean JNICALL nativeImCloseDecoder(JNIEnv* env jclass jclazz) {
im_close_decoder();
return JNI_TRUE;
}
JNIEXPORT jint JNICALL nativeImSearch(JNIEnv* env jclass jc
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-26 17:47 PinyinIME
目录 0 2012-01-10 16:19 PinyinIME
es
目录 0 2012-01-10 16:19 PinyinIME
esdrawable
文件 424 2011-11-15 13:22 PinyinIME
esdrawablespace_icon.png
目录 0 2018-08-04 13:38 __MACOSX
目录 0 2018-08-04 13:38 __MACOSXPinyinIME
目录 0 2018-08-04 13:38 __MACOSXPinyinIME
es
目录 0 2018-08-04 13:38 __MACOSXPinyinIME
esdrawable
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._space_icon.png
文件 365 2011-11-15 13:22 PinyinIME
esdrawablearrow_right.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._arrow_right.png
文件 534 2011-11-15 13:22 PinyinIME
esdrawableemotion_icon_12_popup.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._emotion_icon_12_popup.png
文件 908 2011-11-15 13:22 PinyinIME
esdrawableime_en.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._ime_en.png
文件 492 2011-11-15 13:22 PinyinIME
esdrawableemotion_icon_06_popup.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._emotion_icon_06_popup.png
文件 954 2011-11-15 13:22 PinyinIME
esdrawable
umstar.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._numstar.png
文件 1017 2011-11-15 13:22 PinyinIME
esdrawableshift_off_icon.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._shift_off_icon.png
文件 151 2011-11-15 13:22 PinyinIME
esdrawablecands_container_bg.9.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._cands_container_bg.9.png
文件 593 2011-11-15 13:22 PinyinIME
esdrawablecandidate_balloon_bg.9.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._candidate_balloon_bg.9.png
文件 226 2011-11-15 13:22 PinyinIME
esdrawablecomma_full_popup_icon.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._comma_full_popup_icon.png
文件 128 2011-11-15 13:22 PinyinIME
esdrawableskb_bg.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._skb_bg.png
文件 229 2011-11-15 13:22 PinyinIME
esdrawableemotion_icon_14_popup.png
文件 212 2011-11-15 13:22 __MACOSXPinyinIME
esdrawable._emotion_icon_14_popup.png
............此处省略455个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)