Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
运行JNA';android上的s Native.loadLibrary_Android_Jna - Fatal编程技术网

运行JNA';android上的s Native.loadLibrary

运行JNA';android上的s Native.loadLibrary,android,jna,Android,Jna,我试图在android项目的运行时加载dll库。我可以在一个普通的java项目中使用Native.loadLibrary(“C:\path\u to\u my\u file\my\u dll.dll”,MYLIB.class)”来完成这项工作,但我不能在android上运行同样的程序。我在他们的文档中看到了在android上运行JNA的选项,但也许我错了 我已经将my_dll.dll文件放在android项目的assets文件夹中,但是现在我不知道应该在Native.loadLibrary方法中

我试图在android项目的运行时加载dll库。我可以在一个普通的java项目中使用
Native.loadLibrary(“C:\path\u to\u my\u file\my\u dll.dll”,MYLIB.class)”来完成这项工作,但我不能在android上运行同样的程序。我在他们的文档中看到了在android上运行JNA的选项,但也许我错了


我已经将
my_dll.dll
文件放在android项目的
assets
文件夹中,但是现在我不知道应该在
Native.loadLibrary
方法中放置什么作为第一个参数。

应该为android(linux)编译“dll”你的dll是针对windows的…dll不是针对windows编译的。你应该看看“Android本机开发工具包食谱”。有一节是关于将现有的c/c++项目移植到Android本机libs的。那么为什么它调用my_dll.dll而不是my_dll.so呢?它还必须为正确的CPU类型arm/mips/x86构建,并在apk文件中提供…@Selvin对不起,你说得对,我可以改为加载.h和.c文件吗?还有,我应该把它们放在android项目的什么地方,如何访问它们?