简体   繁体   English

适用于Android Hello World的Adobe AIR

[英]Adobe AIR for Android Hello World

Apologies in advance for asking such stupid questions, but: In Workflow for creating AIR applications for mobile devices , they say to 事先为提出这样愚蠢的问题而道歉,但是:在工作流中,为移动设备创建AIR应用程序时 ,他们说

  1. Create an AIR application descriptor file (using the 2.5, or later, namespace). 创建AIR应用程序描述符文件(使用2.5或更高版本的名称空间)。
  2. Compile the application. 编译应用程序。
  3. Package the application as an Android package (.apk). 将应用程序打包为Android程序包(.apk)。

What do they mean by an AIR application descriptor file? AIR应用程序描述符文件是什么意思? Do they mean application.xml? 他们是指application.xml吗?

What do they mean by the 2.5 namespace? 2.5命名空间是什么意思? I see application xmlns="http://ns.adobe.com/air/application/2.0" in application.xml. 我在application.xml中看到应用程序xmlns =“ http://ns.adobe.com/air/application/2.0”。 How do I get the latest namespace? 如何获得最新的名称空间?

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. 我使用的是Aptana,没有编译菜单选项,所以它们的意思是使用“导出Adobe AIR包”按钮。

What do they mean to Package the application as an Android package? 将应用程序打包为Android软件包意味着什么? Is that the same Export Adobe AIR package button? 这是相同的“导出Adobe AIR”软件包按钮吗? I don't see .apk mentioned anywhere in Aptana. 我没有在.aptana中看到.apk。

Say you have an air app: HelloWorld . 假设您有一个空中应用: HelloWorld

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

By 2.5 namespace they mean, that you must have the current air (2.5 or higher) runtime . 通过2.5命名空间,它们意味着您必须具有当前的air(2.5或更高版本)runtime The current sdk release is the 2.6, downloadable from here. 当前的sdk版本是2.6, 可从此处下载。
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. 我建议您使用(目前最新的) Flex Hero SDK ,它已经与air2.5运行时绑定了,这样您就无需手动合并flex和air SDK。
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. 然后,设置您的环境以使用此新的air sdk,从那时起,将在应用程序描述符xml中生成新版本。

By compiling they mean ... well: compiling. 通过编译,它们的意思是……很好:编译。 making your code understandable by your machine. 使您的计算机可以理解您的代码。 At this point mxmlc should be used (not compc). 此时,应使用mxmlc(而不是compc)。 More about it here . 在这里了解更多 An IDE usually does this in the background eg. IDE通常在后台执行此操作。 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. 编译代码后,您将在bin或bin-release或bin-debug文件夹中拥有适当的swf(无论是否启用了调试)。

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). 通过将应用程序打包到Android包中,它们意味着您必须创建一个.apk文件(该文件和android使用的应用程序包)。 You can create an apk file using the adt command: 您可以使用adt命令创建apk文件:

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

Note 注意

In your application descriptor the visible flag should be set to true: 在您的应用程序描述符中, visible标志应设置为true:

<visible>true</visible>

Your androidManifest.xml file must be embedded into your air application descriptor xml. 您的androidManifest.xml文件必须嵌入到air应用程序描述符xml中。 A sample embedded android manifest is: 嵌入式android清单示例是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM