Archive

Archive for March, 2012

building ZXing as JNI lib

March 6th, 2012 3 comments

i wanted to compare the speed of the cpp and java version of ZXing.

So after fixing some general linux related bugs, it seems to work well as start:

(the following only works with SVN rev. 2218, could be slightly different for later revisions)

0. install the Android NDK

1. check out zxing:

1
2
svn checkout http://zxing.googlecode.com/svn/trunk/ zxing-read-only
cd zxing-read-only

2. fix linux bugs:

1
2
wget http://thomasfischer.biz/wp-content/2012/03/linux-fixes.diff
patch -p0 < linux-fixes.patch

3. setup JNI:

1
2
3
mkdir jni
wget http://thomasfischer.biz/wp-content/2012/03/android-jni.diff
patch -p0 < android-jni.diff

4. build it:

1
2
3
cd android
export NDKHOME=/your/ndk/path/android-ndk-r7b/
ndk-build -j8

i contacted some author of the lib, maybe this will go upstream,
have fun :)

Categories: android, coding Tags: