-
打开要编辑的
HelloWorld-app.xml
。
-
添加根
<application>
元素,包括 AIR 命名空间属性:
<application xmlns="http://ns.adobe.com/air/application/2.7">
命名空间的最后一段“2.7”指定应用程序所需的运行时版本。
-
添加
<id>
元素:
<id>examples.html.HelloWorld</id>
应用程序 ID 与发行商 ID(由 AIR 派生自用于对应用程序包进行签名的证书)一起唯一地标识了应用程序。应用程序 ID 用于安装、访问专用应用程序文件系统存储目录、访问专用加密存储以及应用程序间的通信。
-
添加
<versionNumber>
元素:
<versionNumber>0.1</versionNumber>
可帮助用户确定安装哪个版本的应用程序。
注:
如果您使用的是 AIR 2 或更早版本,则必须使用
<version>
元素,而非
<versionNumber>
元素。
-
添加
<filename>
元素:
<filename>HelloWorld</filename>
用于操作系统中应用程序可执行文件、安装目录和对应用程序的其他引用的名称。
-
添加包含下列子元素的
<initialWindow>
元素,从而为初始应用程序窗口指定属性:
<content>HelloWorld.html</content>
标识 AIR 要加载的根 HTML 文件。
<visible>true</visible>
使窗口立即可见。
<width>400</width>
设置窗口宽度(以像素为单位)。
<height>200</height>
设置窗口高度。
-
保存该文件。完整的应用程序描述符文件应如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/2.7">
<id>examples.html.HelloWorld</id>
<versionNumber>0.1</versionNumber>
<filename>HelloWorld</filename>
<initialWindow>
<content>HelloWorld.html</content>
<visible>true</visible>
<width>400</width>
<height>200</height>
</initialWindow>
</application>
此示例仅设置了几个可能的应用程序属性。有关应用程序属性的完整设置(利用这些设置可以指定窗口镶边、窗口大小、透明度、默认安装目录、关联文件类型以及应用程序图标等),请参阅
AIR 应用程序描述符文件
。