android:android-jni
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
android:android-jni [2010/11/04 13:58] – percy | android:android-jni [2011/03/16 12:24] – percy | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Android JNI多线程相关 ====== | ||
+ | - http:// | ||
+ | - http:// | ||
+ | |||
+ | |||
====== Android JNI相关 ====== | ====== Android JNI相关 ====== | ||
收集一些Android JNI的使用方法。 | 收集一些Android JNI的使用方法。 | ||
Line 4: | Line 9: | ||
- Android JNI详述:参考http:// | - Android JNI详述:参考http:// | ||
- Android JNI 使用的数据结构JNINativeMethod详解:参考http:// | - Android JNI 使用的数据结构JNINativeMethod详解:参考http:// | ||
+ | - JNI编程系列之高级篇:http:// | ||
+ | - JNI 返回结构体参数: | ||
+ | - NDK 应用及扩展介绍: | ||
+ | - JNI tutorial, | ||
+ | - JNI Examples for Android: | ||
====== NDK ====== | ====== NDK ====== | ||
+ | * 教程 | ||
+ | - 【eoe特刊】第七期:Android NDK开发: | ||
* 实例: | * 实例: | ||
- Porting curl to Android - A success story with NDK 1.6:http:// | - Porting curl to Android - A success story with NDK 1.6:http:// | ||
+ | |||
+ | ====== NDK Tips ====== | ||
+ | * NDK的默认Android.mk路径指定在project/ | ||
+ | # | ||
+ | APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/ | ||
+ | | ||
+ | * undefined reference to `wcstombs' | ||
+ | 默认的NDK,在用到wcstombs函数时(已经include < | ||
+ | 可以在这里下载打过patch的版本,http:// | ||
+ | |||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | ====== Linux 网络编程 ====== | ||
+ | - Linux网络编程一步一步学+基础:http:// | ||
+ | |||
+ | ====== NDK编译命令 ====== | ||
+ | 安装cygwin后,把cygwin/ | ||
+ | |||
+ | 再简单一点将这行命令写成一个bat文件,这样只需要在cmd下面直接运行这个bat文件就行了。 | ||
+ | < | ||
+ | bash D: | ||
+ | </ | ||
+ | ====== NDK编译脚本For windows ====== | ||
+ | 简单写了一个脚本,调用ndk-build编译SO文件, | ||
+ | 只支持两个参数 | ||
+ | nkdbuild build | ||
+ | ndkbuild clean | ||
+ | [[android: | ||
+ | |||
+ | ===== NDK编译脚本For Linux ====== | ||
+ | 1.支持编译静态库 | ||
+ | |||
+ | 2.解析Android.mk: | ||
+ | |||
+ | [[android: | ||
+ | |||
+ | |||
+ | ====== ndk-gdb调试 ====== | ||
+ | 利用ndk-gdb可以直接调试native code. | ||
+ | |||
+ | 命令: | ||
+ | bash / | ||
+ | |||
+ | 但在cygwin下调试时遇到了一个问题, | ||
+ | < | ||
+ | D: | ||
+ | GNU gdb 6.6 | ||
+ | Copyright (C) 2006 Free Software Foundation, Inc. | ||
+ | GDB is free software, covered by the GNU General Public License, and you are | ||
+ | welcome to change it and/or distribute copies of it under certain conditions. | ||
+ | Type "show copying" | ||
+ | There is absolutely no warranty for GDB. Type "show warranty" | ||
+ | This GDB was configured as " | ||
+ | / | ||
+ | </ | ||
+ | 找不到app_process文件, | ||
+ | 找到类似的问题: | ||
+ | |||
+ | 方法是修改ndk-gdb: | ||
+ | < | ||
+ | # Get the app_server binary from the device | ||
+ | APP_PROCESS=$APP_OUT/ | ||
+ | #run adb pull / | ||
+ | |||
+ | #Add by Jianqing Peng, | ||
+ | if [ -s " | ||
+ | run adb pull / | ||
+ | else | ||
+ | run adb pull / | ||
+ | fi | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====== native crash log分析 ====== | ||
+ | 参考: | ||
+ | - http:// | ||
+ | - http:// | ||
+ | stack下载: | ||
+ | * http:// | ||
+ | |||
+ | android-ndk-stacktrace-analyzer用法 | ||
+ | < | ||
+ | android-ndk/ | ||
+ | python parse_stack.py mylib.asm logcat.txt | ||
+ | </ | ||
+ | |||
+ | stack用法: | ||
+ | < | ||
+ | python stack.py logcat.txt | ||
+ | </ | ||
+ | 说明: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
/var/www/dokuwiki/wiki/data/pages/android/android-jni.txt · Last modified: 2016/05/05 13:07 by 127.0.0.1