AIR 3 Native Extensions for Android - Can I/How to include 3rd party libraries?

前端 未结 2 1960
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 10:33

With all the new hype surrounding native extension support in AIR 3, I haven\'t found a single thing that confirms or denies it is possible to include and use an external JA

相关标签:
2条回答
  • 2020-11-30 10:56

    You have to combine all your jars into one. Something like http://code.google.com/p/jarjar/ or your own Ant script will help.

    Edited to add example: Suppose your main extension jar file is extension.jar and you are using code in external.jar. Then you can put the classes from external.jar into extension.jar using the Java jar tool:

    jar -xf external.jar

    This will extract the .class files into package folders. If the top-level package is "com", then you can add those to extension.jar with:

    jar -uf extension.jar com

    (Repeat the second command for each top-level package in the external jar.)

    0 讨论(0)
  • 2020-11-30 10:58

    You could also combine the library jars manually by turning them into zip-files (just rename them to .zip) and copy the classes from the 3rd party library into the main one and rename that one back to .jar

    0 讨论(0)
提交回复
热议问题