Recently began to look at the input method related information, first I download a pinyinime source code, want to learn from it to understand the input method more in-depth, to be able to add an input method of the ability, the first step must be compiled through, I like to use the NDK way, the source copy to the Ubuntu system after the start of the compilation journey, The following two issues are fixed:
The first problem is the lack of file cutils/log.h, two files are used, respectively, Jni/android/com_android_inputmethod_pinyin_pinyindecoderservice.cpp and jni/ Share/userdict.cpp, in fact, this file is printed log used, we can define the Android log printing, I directly commented out, not a few places, the first file Com_android_inputmethod_pinyin _pinyindecoderservice.cpp in the Registernativemethods function two, the second file userdict.cpp is the definition of logd_perf used;
The second problem is android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/. /lib/gcc/arm-linux-androideabi/4.6/. /.. /.. /.. /arm-linux-androideabi/bin/ld:error:cannot Find-lpthread, then modify the next jni/android.mk can be, the local_ldlibs + =-lpthread changed to Local_ Ldlibs + =-pthread.
This compiles the work to be accomplished.
Pinyinime Source NDK Compilation problem