Bulldog on Android

90 views
Skip to first unread message

S1th

unread,
Dec 5, 2014, 5:12:17 AM12/5/14
to libbu...@googlegroups.com
Hi,

I am planning to use libbulldog on android.

I have successfully, built the jar and the shared lib, wrote a simple test program to access bulldog.

The app loads libbulldog.so but, fails saying,

java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "ioctl" referenced by "libbulldog-linux.so"...

Any idea why this is so? Is it a problem with ioctl or root permissions?

Has anybody tired this on Android before if so what's your experience?

Regards,
S1th

S1th

unread,
Dec 5, 2014, 9:26:00 AM12/5/14
to libbu...@googlegroups.com
Ok,

Finally got it working.

Struggled for 3 full nights and finally cracked it.

Need to build libbulldog-linux.so with NDK and statically providing libc.a to the shared library libbulldog-linux.so.
Here is my build process.
1. Copied all the files to jni folder
2. Built Android.mk
3. Set to include android toolchain include directory. This is for I2C and Spi access
4. Do ndk-build

My Android.mk script

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := libbulldog-linux
LOCAL_CFLAGS    := -std=gnu99 -O3 -fPIC -fgnu89-inline -mlittle-endian -DARM -DARCH=\ARM\  -marm  -mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations -static -shared  -I <path-to-ndk-toolchain>/android-ndk-r10c/platforms/android-21/arch-arm/usr/include
LOCAL_SRC_FILES := bulldog.c \
bulldog.h \
bulldogI2c.c \
bulldogI2c.h \
bulldogSerial.c \
bulldogSerial.h \
bulldogSpi.c \
bulldogSpi.h \
org_bulldog_linux_jni_NativeEpoll.c \
org_bulldog_linux_jni_NativeEpoll.h \
org_bulldog_linux_jni_NativeI2c.c \
org_bulldog_linux_jni_NativeI2c.h \
org_bulldog_linux_jni_NativeMmap.c \
org_bulldog_linux_jni_NativeMmap.h \
org_bulldog_linux_jni_NativeSerial.c \
org_bulldog_linux_jni_NativeSerial.h \
org_bulldog_linux_jni_NativeSpi.c \
org_bulldog_linux_jni_NativeSpi.h \
org_bulldog_linux_jni_NativeTools.c \
org_bulldog_linux_jni_NativeTools.h

LOCAL_LDLIBS    := -llog -l<path-to-ndk-toolchain>/android-ndk-r10c/platforms/android-21/arch-arm/usr/lib/libc.a

include $(BUILD_SHARED_LIBRARY)


Got my App up and running.
Now figuring out root access to the box so that the app can write to /sys/class/gpio

I will post the updates.

Jacob Krueger

unread,
Feb 12, 2015, 5:26:18 PM2/12/15
to libbu...@googlegroups.com
Hi S1th, I'm attempting to use the libbulldog for BBB on Android 4.4 as well.

I followed your very excellent instructions in this thread but ended up with an error different from your original one. Mine was "java.lang.noclassdeffounderror: org.bulldog.core.platform.Platform". My Android.mk file is as follows:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := UCFEzNAV
LOCAL_CFLAGS    := -std=gnu99 -O3 -fPIC -fgnu89-inline -mlittle-endian -DARM -DARCH=\ARM\  -marm  -mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations -static -shared  -I C:/Users/Jacob/COP4331_Development/adt-bundle-windows-x86_64-20140702/sdk/NDK/android-ndk-r10d/platforms/android-21/arch-arm/usr/include
LOCAL_SRC_FILES := libbulldog-linux.so

LOCAL_LDLIBS    := -llog -l C:/Users/Jacob/COP4331_Development/adt-bundle-windows-x86_64-20140702/sdk/NDK/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib/libc.a

include $(BUILD_SHARED_LIBRARY)

Jacob Krueger

unread,
Feb 12, 2015, 7:26:40 PM2/12/15
to libbu...@googlegroups.com
In a follow up to my original post, I'm new to using NDK and I'm a little confused as to where you got the .c and .h files. I only received the .so file when downloading libbulldog.

Datenheld

unread,
Feb 13, 2015, 8:54:35 AM2/13/15
to libbu...@googlegroups.com
Hi Jacob,

Android is not officially supported. There have been attempts by some other guy to port it but he struggled with getting GPIO to work.

I have not worked on the Android part in months.

Sorry to say that. You can find the attempts of getting libbulldog to run on Android in the Devline2 branch:


So far, it's just a build for Android but it probably needs a lot of work to make it functional.
Reply all
Reply to author
Forward
0 new messages