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

后端 未结 1 1631
后悔当初
后悔当初 2020-12-18 11:11

I have build a pretty nice little app using Adobe Air Mobile (FlashBuilder) and Android Native Extensions (ANE). I would like to incorporate the Jayspt encryption library

相关标签:
1条回答
  • 2020-12-18 11:28

    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] . 
    
    0 讨论(0)
提交回复
热议问题