如何在 Adob​​e Air Mobile 的 Android Native Extension 中包含额外的 Jar [英] How to include additional Jar in Android Native Extension for Adobe Air Mobile

查看:15
本文介绍了如何在 Adob​​e Air Mobile 的 Android Native Extension 中包含额外的 Jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Adob​​e Air Mobile (FlashBuilder) 和 Android Native Extensions (ANE) 构建了一个非常漂亮的小应用程序.我想将 Jayspt 加密库与我的 ANE 合并,但我似乎找不到任何说明如何操作的文档.如果我为 ANE 构建执行标准 ADT 导出到 jar,它不包括 jayspt jar.

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 with my ANE but I can't seem to find any documentation telling how to do it. If I do the standard ADT export to jar for the ANE build, it doesn't include the jayspt jar.

有谁知道如何(为我拼写)在 ANE 中包含另一个罐子?

Does anyone know how (spell it out for me) to include another jar in the ANE?

谢谢,脸书

推荐答案

首先确保您使用的是 AIR 4.0+ 来打包.早期版本肯定也可以这样做,但以下方法更容易,并且不需要重新包装 jar.首先,您只需将它作为外部库添加到您的 Android 项目中,这将使您的代码中的所有功能都可用.

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.

然后为android创建一个platform-options-android.xml,它应该如下所示:

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>

您需要确保 jayspt.jar 文件与您的本机扩展 jar 文件位于同一目录中.

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

现在在你的打包脚本中确保你为 android 指定了平台选项:

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] . 

这篇关于如何在 Adob​​e Air Mobile 的 Android Native Extension 中包含额外的 Jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆