package com.example.imagetogray;
public class LibFuns {
static {
System.loadLibrary("ImgToGray");
}
/**
* @param width the current view width
* @param height the current view height
*/
public native int[] ImgToGray(int[] buf, int w, int h);
}
这是声明!!
LibFuns myjni=new LibFuns();//new 一个自定义libfuns对象
int[] resultInt=myjni.ImgToGray(pix, w, h);//调用so中的灰度图处理方法
调用是这样的。
我这里只要new 程序就会直接崩溃退出。
本人刚接触安卓,请大神指教!!!!