将数据从Java文件传递到cpp

时间:2014-03-17 14:40:29

标签: java android c++ eclipse

我试图从示例代码中创建java中的对象检测算法 here。 但是在代码中,图像值是硬编码的。我可以通过自己的方式传递图像位置。

   const char * imgInFile = "/sdcard/nonfree/img1.jpg";// Need to pass custom values
const char * imgOutFile = "/sdcard/nonfree/img1_result.jpg";

谢谢

1 个答案:

答案 0 :(得分:0)

您可以向runDemo方法添加字符串参数。您应该在java中更改方法签名并修复nonfree_jni.cpp文件中的jni方法原型并... Goolge how to pass string to jni.