How to include additional Jar in Android Native Extension for Adobe Air Mobile

烈酒焚心 提交于 2019-11-29 08:02:22

Firstly make sure you're using AIR 4.0+ to package. Earlier versions definitely can do it as well but the following method is much easier and doesn't require repackaging of the jar. Firstly you just add it to your Android project as an external lib, this will make all the functions available in your code.

Then create a platform-options-android.xml for android, it should look like the following:

<platform xmlns="http://ns.adobe.com/air/extension/4.0">
    <packagedDependencies>
        <packagedDependency>jayspt.jar</packagedDependency>
    </packagedDependencies>
    <packagedResources>
    </packagedResources>
</platform>

You'll need to make sure that the jayspt.jar file sits in the same directory as your native extension jar file.

Now in your packaging script make sure you specify the platform options for android:

adt -package [YOUR NORMAL OPTIONS] \
     -platform Android-ARM -platformoptions platform-options-android.xml -C [PATH TO YOUR LIB] . 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!