问题
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