适用于 Android 的 Adob​​e AIR Hello World [英] Adobe AIR for Android Hello World

查看:21
本文介绍了适用于 Android 的 Adob​​e AIR Hello World的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提前为问这些愚蠢的问题道歉,但是:在为移动设备创建 AIR 应用程序的工作流程中,他们说

Apologies in advance for asking such stupid questions, but: In Workflow for creating AIR applications for mobile devices, they say to

  1. 创建一个 AIR 应用程序描述符文件(使用 2.5 或更高版本的命名空间).
  2. 编译应用程序.
  3. 将应用程序打包为 Android 包 (.apk).

AIR 应用程序描述符文件是什么意思?他们是说application.xml吗?

What do they mean by an AIR application descriptor file? Do they mean application.xml?

2.5 命名空间是什么意思?我在 application.xml 中看到 application xmlns="http://ns.adobe.com/air/application/2.0".如何获取最新的命名空间?

What do they mean by the 2.5 namespace? I see application xmlns="http://ns.adobe.com/air/application/2.0" in application.xml. How do I get the latest namespace?

编译应用程序是什么意思?我正在使用 Aptana 并且没有编译菜单选项,所以他们的意思是使用导出 Adob​​e AIR 包"按钮.

What do they mean by Compile the application? I'm using Aptana and there's no compile menu option, so do they mean to use the Export Adobe AIR package button.

将应用程序打包为 Android 包是什么意思?那是同一个导出 Adob​​e AIR 包"按钮吗?我在 Aptana 的任何地方都没有看到 .apk.

What do they mean to Package the application as an Android package? Is that the same Export Adobe AIR package button? I don't see .apk mentioned anywhere in Aptana.

推荐答案

假设你有一个 air 应用:HelloWorld.

Say you have an air app: HelloWorld.

应用程序描述符文件是指 HelloWorld-app.xml 文件,您可以在其中配置应用程序的行为和基本显示(大小、图标等)

By application descriptor file they mean the HelloWorld-app.xml file, where you configure the behavior and basic display of your application (size, icons, etc.)

通过 2.5 命名空间,它们的意思是您必须具有当前的 air(2.5 或更高版本)运行时.当前的 sdk 版本是 2.6,可从此处下载.
我建议您使用(目前最新的)Flex Hero SDK虽然已经绑定了air2.5运行时,这样就不需要手动合并flex和air SDK了.
然后您将环境设置为使用这个新的 air sdk,从那时起,将在您的应用程序描述符 xml 中生成新版本.

By 2.5 namespace they mean, that you must have the current air (2.5 or higher) runtime. The current sdk release is the 2.6, downloadable from here.
I'd suggest you to use the (currently latest) Flex Hero SDK though, which is already bound with the air2.5 runtime, this way you don't need to merge the flex and air SDKs manually.
Then you set up your environment to use this new air sdk, and from that point on, in your application descriptor xml the new version will be generated.

编译的意思是……嗯:编译.使您的机器可以理解您的代码.此时应使用 mxmlc(而不是 compc).点击此处了解详情.IDE 通常在后台执行此操作,例如.在每次保存操作中,或者在运行之前,所以您可能不应该打扰.
编译代码后,您的 bin 或 bin-release 或 bin-debug 文件夹中将拥有正确的 swf(启用或不启用调试).

By compiling they mean ... well: compiling. making your code understandable by your machine. At this point mxmlc should be used (not compc). More about it here. An IDE usually does this in the background eg. on every save action, or right before running, so probably you shouldn't bother.
After compiling your code, you'll have the proper swf (either debug-enabled or not) inside your bin or bin-release or bin-debug folder.

通过将应用程序打包到 Android 包中,它们意味着您必须创建一个 .apk 文件(即 android 使用的应用程序包).您可以使用 adt 命令创建一个 apk 文件:

By packaging the application into an Android package, they mean that you have to create an .apk file (that's and application package used by android). You can create an apk file using the adt command:

adt -package 
    -target apk 
    -storetype [yourstoretyp] 
    -keystore [yourkeystore] HelloWorld.apk HelloWorld-app.xml HelloWorld.swf 

注意

在您的应用程序描述符中,visible 标志应设置为 true:

In your application descriptor the visible flag should be set to true:

<visible>true</visible>

您的 androidManifest.xml 文件必须嵌入到您的空中应用描述符 xml 中.一个示例嵌入式 android 清单是:

Your androidManifest.xml file must be embedded into your air application descriptor xml. A sample embedded android manifest is:

<application>
    [...]
    <android>
        <manifestAdditions>
            <![CDATA[
                <manifest android:installLocation='auto'>
                    <uses-permission android:name="android.permission.INTERNET" />
                    <supports-screens android:normalScreens="true"/>
                    <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
                    <application android:enabled="true">
                        <activity android:excludeFromRecents="false">
                            <intent-filter>
                                <action android:name="android.intent.action.MAIN" />
                                <category android:name="android.intent.category.LAUNCHER" />
                            </intent-filter>
                        </activity>
                    </application>
                </manifest>
            ]]>
        </manifestAdditions>
    </android>
    [...]
</application>

这篇关于适用于 Android 的 Adob​​e AIR Hello World的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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