ndk如何将代码放在jni之外

LOCAL_PATH := $(call my-dir)
SDK_PATH := ../../..

include $(CLEAR_VARS)
LOCAL_MODULE := libiconv_static
LOCAL_SRC_FILES := $(SDK_PATH)/base/3dparty/libiconv/android/lib/armeabi/libiconv.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libxml2_static
LOCAL_SRC_FILES := $(SDK_PATH)/base/3dparty/libxml2/android/lib/armeabi/libxml2.a
LOCAL_STATIC_LIBRARIES := libiconv_static
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libcurl_static
LOCAL_SRC_FILES := $(SDK_PATH)/base/3dparty/libcurl/android/lib/armeabi/libcurl.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libuv_static
LOCAL_SRC_FILES := $(SDK_PATH)/base/3dparty/libuv/android/lib/armeabi/libuv.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:= sdk
LOCAL_SRC_FILES :=main.cpp \
$(SDK_PATH)/base/3dparty/jsoncpp/src/json_writer.cpp \
$(SDK_PATH)/base/3dparty/jsoncpp/src/json_value.cpp \
$(SDK_PATH)/base/3dparty/jsoncpp/src/json_reader.cpp \
$(SDK_PATH)/base/decode/base64.c \
$(SDK_PATH)/base/decode/des.c\
$(SDK_PATH)/base/thread/thread.cpp \
$(SDK_PATH)/base/tool/setting.cpp \
$(SDK_PATH)/base/tool/logger.cpp \
$(SDK_PATH)/base/network/Transfer.cpp \
$(SDK_PATH)/base/network/MultiTransfer.cpp\
$(SDK_PATH)/base/network/UVThread.cpp\
$(SDK_PATH)/base/network/UVAsyncMessage.cpp\
$(SDK_PATH)/base/BaseFacade.cpp \
$(SDK_PATH)/core/SDK.cpp \
$(SDK_PATH)/core/Module.cpp \
$(SDK_PATH)/core/Method.cpp \
$(SDK_PATH)/core/HttpResponse.cpp\
$(SDK_PATH)/core/HttpRequest.cpp \
$(SDK_PATH)/core/AsyncProxy.cpp \
$(SDK_PATH)/core/AsyncThread.cpp \
$(SDK_PATH)/core/AsyncCallBackThread.cpp\
$(SDK_PATH)/core/API.cpp \
$(SDK_PATH)/core/CommentModule/CommentModule.cpp \
$(SDK_PATH)/core/CommentModule/CommentMethods.cpp

LOCAL_CPP_EXTENSION := .cpp .inl
LOCAL_CPP_FEATURES := exceptions
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDK_PATH)\
$(LOCAL_PATH)/$(SDK_PATH)/base/3dparty/jsoncpp/include\
$(LOCAL_PATH)/$(SDK_PATH)/base/3dparty/libcurl/android/include\
$(LOCAL_PATH)/$(SDK_PATH)/base/3dparty/libxml2/android/include\
$(LOCAL_PATH)/$(SDK_PATH)/base/3dparty/libiconv/android/include\
$(LOCAL_PATH)/$(SDK_PATH)/base/3dparty/libuv/android/include
LOCAL_CFLAGS := -lpthread -DSDK_DEBUG_ANDROID
LOCAL_LDLIBS := -lz -llog
LOCAL_STATIC_LIBRARIES := libxml2_static libcurl_static libuv_static
include $(BUILD_SHARED_LIBRARY)

时间: 2024-10-01 04:50:30

ndk如何将代码放在jni之外的相关文章

android eclipse NDK 测试hello-jni ,HelloJni/jni/hello-jni.c提示“Method 'NewStringUTF' could not be resolved”

如图1 图1 问题: 方法 NewStringUTF 不能被 eclipse定位(鼠标放在该方法上,ctrl + 左键,跳出一些包含 该方法的文件,看图2) 解决思路:(具体思路看下文,参考中“推荐”) 参考网上其他人的解决方案,基本2类: 1. 去警告-> 看下图3: 2. 找到错误方法所在文件位置(图3),包含进 项目属性(propertities -> C/C++ General -> Paths and Sysmbols -> include -> add ->

【Android开发】NDK开发(2)-jni数据类型

一.      Java数据类型与jni数据类型对应关系 基本数据类型 一维数组 Java类型 jni类型 Java类型 jni类型 void void boolean jboolean boolean[] jbooleanArray byte jbyte byte[] jbyteArray char jchar char[] jcharArray short jshort short[] jshortArray int jint int[] jintArray long jlong long[

【Android开发】NDK开发(3)-jni开发技巧

一.      jni打印调试信息 1.    在Android.mk文件中添加: LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog 2.     在 .c文件中添加: #include <android/log.h> 3.      打印log信息: __android_log_print(ANDROID_LOG_INFO, "INIT_GETGPSINFO", "get_gps_info"); //或者 __and

asp.net中ashx生成验证码代码放在Linux(centos)主机上访问时无法显示问题

最近有个项目加入了验证码功能,就从自己博客以前的代码中找到直接使用,直接访问验证码页面报错如下: 源代码:asp.net中使用一般处理程序生成验证码 Application Exception System.ArgumentException The requested FontFamily could not be found [GDI+ status: FontFamilyNotFound] Description: HTTP 500.Error processing request. De

Don’t Put View Code Into Your View Controller别把View创建的代码放在VC中(swift)

Don't Put Into Your View Controller别把View创建的代码放在VC中html, body {overflow-x: initial !important;}.CodeMirror { height: auto; } .CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; } .CodeMirror-lines { padding: 4px 0px; } .CodeMirror pre { paddin

微软的.NET示例代码放在Github上了

博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:微软的.NET示例代码放在Github上了.

Linux命令行下编译Android NDK的示例代码

这几天琢磨写一个Android的Runtime用来加速HTML5 Canvas,让GameBuilder+CanTK 不但开发速度快,运行速度也能接近原生应用.所以花了点时间研究 Android NDK,网上的资料都是讲IDE里的编译方法,这里记录一下命令行下的编译方法,供有需要的朋友参考. 这里以编译hello-gl2为例: 0.安装Android NDK/SDK,设置PATH变量(根据具体情况调整) PATH=$PATH:/work/android/android-sdk-linux/pla

JavaScript代码放在HTML代码不同位置的差别

通常情况下,JavaScript 代码是和 HTML 代码一起使用的,可以将 JavaScript 代码放置在 HTML 文档的任何地方.但放置的地方,会对 JavaScript 代码的正常执行会有一定影响,具体如下所述. 1.放置于<head></head>之间 将 JavaScript 代码放置于 HTML 文档的 <head></head> 标签之间是一个通常的做法.由于 HTML 文档是由浏览器从上到下依次载入的,将 JavaScript 代码放置于

Android ndk第一步,构建jni headers

转载请注明出处:http://www.cnblogs.com/fpzeng/p/4281801.html 源码请见 https://github.com/fpzeng/HelloJNI 系统: ubuntu 12.04 在android上使用ndk的步骤: 创建java文件,声明native方法: 使用javah生成C语言接受的头文件*.h: 创建*.c文件,使用C语言实现该native方法: 编译*.c文件产生so库 运行的时候,java使用System.loadLibrary打开so库,调用