2011-04-22 68 views
0

道歉提前問這樣愚蠢的問題,而是: 在Workflow for creating AIR applications for mobile devices,他們對的Adobe AIR針對Android的Hello World

  1. 說創建AIR應用程序描述符文件(使用2.5或更高版本的命名空間)。
  2. 編譯應用程序。
  3. 將應用程序打包爲Android包(.apk)。

它們是什麼意思的AIR應用程序描述符文件?他們的意思是application.xml嗎?

2.5命名空間是什麼意思? 我在application.xml中看到應用程序xmlns =「http://ns.adobe.com/air/application/2.0」。 如何獲取最新的命名空間?

編譯應用程序是什麼意思?我正在使用Aptana,並且沒有編譯菜單選項,所以它們的意思是使用導出Adobe AIR軟件包按鈕。

將應用程序打包爲Android包是什麼意思?這是相同的導出Adobe AIR軟件包按鈕?在Aptana的任何地方我都沒有看到.apk。

回答

4

假設您有空氣應用程序:HelloWorld

由應用程序描述符文件,他們的意思是HelloWorld-app.xml文件,在其中配置您的應用程序(大小,圖標等)

的行爲和基本陳列到2.5命名空間,他們的意思是,你必須有current air (2.5 or higher) runtime。目前的sdk版本是2.6,0.
我建議你使用(當前最新的)Flex Hero SDK雖然它已經綁定到air2.5運行時,這樣你就不需要合併flex和air SDKs手動。
然後,您將您的環境設置爲使用這個新的空氣sdk,並從這一點開始,在您的應用程序描述符xml中生成新版本。

編譯它們意味着......編譯。使您的代碼可以通過您的機器理解。此時應使用mxmlc(而不是compc)。 More about it here。 IDE通常在後臺執行此操作,例如。在每一次保存行動中,或在跑步之前,所以可能你不應該打擾。
編譯完代碼後,您將在bin或bin-release或bin-debug文件夾中擁有正確的swf(啓用或不啓用調試)。

通過將應用程序打包成Android包,他們的意思是,你必須創建一個.apk文件(這是和應用程序包由Android使用)。您可以使用ADT命令創建APK文件:

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

注意

在您的應用程序描述visible標誌應當設置爲true:

<visible>true</visible> 

AndroidManifest.xml檔案必須嵌入到您的空氣應用程序描述符xml中。一個嵌入式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> 
+1

Rekaszeru,非常感謝你這麼長時間的迴應! – 2011-04-22 17:14:23

+0

沒問題,我希望你能快速工作!如果有任何疑問,請不要猶豫,問一個新問題。 – rekaszeru 2011-04-22 17:32:33