I am working on an app in android where I have a Java class containing android.graphics.Bitmap package
I want to create a header file using javah but getting an error:
Class android.graphics.Bitmap not found
I am working on an app in android where I have a Java class containing android.graphics.Bitmap package
I want to create a header file using javah but getting an error:
Class android.graphics.Bitmap not found
I think you are trying to develop an openCV app.
So you basically want to call methods from the openCV library, that are not implemented in java yet, but are available as native C or C++ methods. Try to circumvent that, because jni-calls are expensive.
#include <jni.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <vector>
using namespace std;
using namespace cv;
extern "C" {
JNIEXPORT void JNICALL Java_[your]_[package]_[com]_[class]_[method](JNIEnv* env, jobject thiz, jlong addrGray, jlong addrRgba)
{
//do stuff
}
you can call this method now from your java class:
public native void method(long matAddrGr, long matAddrRgba);