Native Android project referencing a shared library from a C ++ library project

I have 2 projects:

1 - Android Native project
2 - C / C ++ project

I create shared library (.so) files in a C / C ++ project and want to use these .so files in Android Native. I do not want to copy and paste these library files from one project to another.

First of all, you can use these .so files from my native Android project using some link, etc. into a C ++ library project?

Would it be easier to find a way to automatically copy .so files from a C ++ library project to your own Android project?

+5
source share
1 answer

, ARM. ndk "standalone toolchain". doc ddk dir (docs/STANDALONE-TOOLCHAIN.html). libexpat , bash expat toolchain, :

NDK_PATH=/android-ndk-r7
NDK_GCC=${NDK_PATH}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc

export CC="${NDK_GCC} --sysroot=${NDK_PATH}/platforms/android-8/arch-arm"
export CFLAGS='-mthumb'
export LDFLAGS='-Wl,--fix-cortex-a8'
./configure --host=arm-eabi
make

, , Android.mk:

LOCAL_LDLIBS := \
-Lvendor/expat/sdk/lib/android \
-lexpat

, expat , .

+1

All Articles