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