我有问题移植并使用Android-ndk-r5b将boost库链接到android.我首先使用以下步骤构建boost库(没有mpi,python):
# if [ os.name ] = "NT" { api = win32 ; }
androidNDKRoot = ../android-ndk-r5b ;
using gcc : android4.4.3 : $(androidNDKRoot)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-g++.exe :
--sysroot=$(androidNDKRoot)/platforms/android-3/arch-arm
-mthumb
-Os
-fno-strict-aliasing
-O2
-DNDEBUG
-g
-fexceptions
-frtti
-lstdc++
-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/include
-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include
-D__GLIBC__
-DBOOST_NO_INTRINSIC_WCHAR_T
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-ar.exe
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-ranlib.exe
linux
;
bjam.exe --user-config=user-config.jam --without-python --without-mpi toolset=gcc-android4.4.3 link=static runtime-link=static target-os=linux --stagedir=android > d:\out.txt
APP_STL := gnustl_static APP_PLATFORM := android-3 APP_CPPFLAGS += -mthumb APP_CPPFLAGS += -Os APP_CPPFLAGS += -fno-strict-aliasing APP_CPPFLAGS += -O2 APP_CPPFLAGS += -DNDEBUG APP_CPPFLAGS …
在Android的NDK刚刚显著扩大到包括完全在本地C/C++代码编写Android应用程序的支持.现在人们可以捕捉使用原生代码,键盘和触摸屏上输入事件,并且还实现在C/C++使用新的NativeActivity的类的应用程序生命周期.
鉴于所有扩展的本机功能,完全绕过Java并在本机代码中编写Android应用程序是否值得?