Merge "Build libsimplejni using SDK"

am: 86c0968a05

Change-Id: I43df59745f8cc50a9385e67d3e55d54fce431b56
This commit is contained in:
Jiyong Park
2018-02-15 07:50:09 +00:00
committed by android-build-merger
2 changed files with 11 additions and 8 deletions

View File

@@ -31,18 +31,15 @@ LOCAL_SRC_FILES:= \
native.cpp
# All of the shared libraries we link against.
LOCAL_SHARED_LIBRARIES := \
liblog
LOCAL_LDLIBS := -llog
# No static libraries.
LOCAL_STATIC_LIBRARIES :=
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)
LOCAL_CFLAGS := -Wall -Werror
LOCAL_CXX_STL := none
LOCAL_NDK_STL_VARIANT := none
LOCAL_SDK_VERSION := current
include $(BUILD_SHARED_LIBRARY)

View File

@@ -15,12 +15,18 @@
*/
#define LOG_TAG "simplejni native.cpp"
#include <utils/Log.h>
#include <android/log.h>
#include <stdio.h>
#include "jni.h"
#define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
#define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define ALOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
static jint
add(JNIEnv* /*env*/, jobject /*thiz*/, jint a, jint b) {
int result = a + b;