NDK HOWTO
来源:互联网 发布:北京理工网络教育官网 编辑:程序博客网 时间:2024/06/05 20:00
如何使用java的NDK轻松调用C或者C++函数库
一 Android添加自己的动态库
在 build/core/prelink-linux-arm.map 或者build/core/prelink-linux-mips.map 加入自己的动态库的定义
二
原文网址:http://macholad-hotmail-com.javaeye.com/blog/889022
android编译时添加库第三方库文件
android/customization/custom_normal/vendor/third-party/libs/Android_cust.mk 中
include $(CLEAR_VARS)LOCAL_PREBUILT_LIBS += libhello-jni.so include $(BUILD_MULTI_PREBUILT)在上述mk文件中添加上述代码 可以在编译时将
android/customization/custom_normal/vendor/third-party/libs/libhello-jni.so 库文件添加到android系统库目录中
三
1 进入工程的目录然后使用 $(NDK)/ndk-build
ubuntu@ubuntu-desktop:~/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni$ pwd/home/ubuntu/android/ToolsForLinux/android-ndk-r4b/samples/hello-jniubuntu@ubuntu-desktop:~/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni$ ../../ndk-build -B v=1Gdbserver : [arm-eabi-4.4.0] /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni/libs/armeabi/gdbserverGdbsetup : /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni/libs/armeabi/gdb.setupGdbsetup : + source directory /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni/jniCompile thumb : hello-jni <= /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni/jni/hello-jni.cSharedLibrary : libhello-jni.soInstall : libhello-jni.so => /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni/libs/armeabiubuntu@ubuntu-desktop:~/android/ToolsForLinux/android-ndk-r4b/samples/hello-jni$
2 in apps
a) make file pplication.mk
其中Application.mk 如下:
APP_PROJECT_PATH := /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/apps/hello-jni
b)
ubuntu@ubuntu-desktop:~/android/ToolsForLinux/android-ndk-r4b$ubuntu@ubuntu-desktop:~/android/ToolsForLinux/android-ndk-r4b$ make APP=hello-jniAndroid NDK: Building for application 'hello-jni' Gdbserver : [arm-eabi-4.4.0] /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/apps/hello-jni/libs/armeabi/gdbserverGdbsetup : /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/apps/hello-jni/libs/armeabi/gdb.setupGdbsetup : + source directory /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/apps/hello-jni/jniCompile thumb : hello-jni <= /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/apps/hello-jni/jni/hello-jni.cSharedLibrary : libhello-jni.soInstall : libhello-jni.so => /home/ubuntu/android/ToolsForLinux/android-ndk-r4b/apps/hello-jni/libs/armeabiubuntu@ubuntu-desktop:~/android/ToolsForLinux/android-ndk-r4b$
- NDK HOWTO
- HowTo
- HOWTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)
- HOWTO install and setup Android NDK for Linux(Android NDK安装遇到的问题和解决方法)
- HOWTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)
- [howto]Install_mod_python_win2k
- JET Howto
- kernel howto
- HOWTO MPlayer
- APT HOWTO
- Framebuffer HOWTO
- p2psim:howto
- NHibernate Howto
- MogileFS HOWTO
- Makefile Howto
- LVS-HOWTO
- SquashFS HOWTO
- Dstile howto
- UDP分包重组算法
- 数据结构 教程
- BMP之二:转成RAW文件及应用
- 【zz】嵌入式linux GUI--DirectFB + GTK至尊秘笈
- rsync命令
- NDK HOWTO
- oracle 对表的语句监控
- java.util.logging使用示例
- Android Google Map实例 - 添加Google Map自定义图层(Android mapview)
- JGroups入门
- 20110304代码开发小结
- f803.cpp
- 使用timeval获取Linux 毫秒级计时
- 高性能并发TCP网络服务-IOCP框架修正VC2008版本