Archive

Archive for the ‘android’ Category

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:

resolve symbols for android’s ndk-gdb

December 6th, 2010 No comments

very simple if you know how:

1
2
cd <your-android-ndk-project-dir>
cp <path-to-mydroid-dir>/out/target/product/generic/symbols/system/lib/* obj/local/armeabi/
Categories: android, coding Tags:

android – prevent screen locking from shell

November 16th, 2010 No comments
1
2
3
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value = '1800000' where name = 'screen_off_timeout';"
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value = '3' where name = 'stay_on_while_plugged_in';"
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value = '0' where name = 'screen_brightness_mode';"
Categories: android Tags:

Monkeys in Android

November 8th, 2010 No comments

funny things directly from the Android API documentation:

public static boolean isUserAMonkey ()
Returns "true" if the user interface is currently being messed with by a monkey.

http://developer.android.com/reference/android/app/ActivityManager.html#isUserAMonkey%28%29

EDIT: monkey is this: http://developer.android.com/guide/developing/tools/monkey.html

Categories: android, coding Tags: