0
我崩溃时,我打电话给我的原生功能,在这里我的Android应用程序是我的代码:的Android NDK(OpenCV的)
lib libo=new lib();
public void onPreviewFrame(byte[] data, Camera camera)
{
int s;// where w and h are width and height are the parameters of the camera
s=libo.getdata(data);/: and getdata is my native function
}
我getdata.c:
#include "getdata.h"
JNIEXPORT int JNICALL JAVA_android_video8_libo_som
(JNIEnv* env, jobject obj,jbyte* data)
{
return (data[1]);
}
getdata.h:
#include <jni.h>
#ifndef _Included_android_video8_lib
#define _Included_android_video8_lib
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT int JNICALL JAVA_android_video8_libo_som(JNIEnv* env, jobject obj, jbyte*);
#ifdef __cplusplus
}
#endif
#endif
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := opcv
LOCAL_SRC_FILES := getdata.c
include $(BUILD_SHARED_LIBRARY)
和类在那里我打电话的lib:
package android.video8;
public class libo {
static {
System.loadLibrary("opcv");
}
public native static int som(int s);
}
没有问题,但应用程序的执行产生库
给我一个崩溃 我不没有地方EHE误差 感谢
你到底想要完成什么? – 2011-05-18 08:25:01