How to include jar files in phonegap android application?

岁酱吖の 提交于 2019-12-08 10:20:15

问题


I am using a third party jar which has java class files and also .so files in my armeabi folder and i want to use the functions of the jar into my phonegap application which i am running on android platform. I tried with including the jar in plugin.xml with the following command :

<source-file src="src/android/xxx.jar" target-dir="libs" framework="true" />
<source-file src="src/android/MyPlugin.java" target-dir="src/com/mypackage" />

this doesn't work. can anybody help and what's the proper way of including .so files and jar file into the project and access it's function in javascript.. Thanks in advance!!!


回答1:


This works great for me: <source-file src="libs/mylib.jar" target-dir="libs" />

"libs" is the default folder for storing .jar files so your lib will be linked.

Take a look at an existing plugin using an external lib.

An example (https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin)



来源:https://stackoverflow.com/questions/31341904/how-to-include-jar-files-in-phonegap-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!