structure of the application description file
Application description file Application.xml, contains the entire program's properties, such as name, version, copyright and so on. Any file name can be used as a program description file, and Flex Builder automatically creates a profile when the project is created. The description file is renamed to Application.xml when you package the program, whether using Flex Builder or ADT.
Here is an example of a description file:
<?xml version= "1.0" encoding= "Utf-8"?> <application appid= "Com.adobe.air.examples.HelloWorld" version= "2.0 "xmlns=" http://ns.adobe.com/air/application/1.0.M4 "> <name>air Hello world</name> <description > This is the "Hello World" sample file from the Adobe AIR documentation. </description> <title>helloworld--AIR example</title> <copyright>copyright©2006</ Copyright> <rootcontent systemchrome= "None" Transparent= "true" visible= "true" width= "640" height= "480" > helloworld-debug.swf </rootContent> <installFolder>Adobe/Examples</installFolder> <icon> <image16x16>icons/smallIcon.png</image16x16> <image32x32>icons/mediumicon.jpg</image32x32 > <image48x48>icons/bigIcon.gif</image48x48> <image128x128>icons/biggesticon.png</ image128x128> </icon>
defining the properties of an application description file
The root element of the program description file is the Application field, which contains several properties:
<application appid= "Com.adobe.air.HelloWorld" version= "1.0" xmlns= "Http://ns.adobe.com/air/application/1.0.M4" >
AppID: The unique identifier for the program, which can consist of the following characters:
0-9
A-Z
A-Z
. Point
-(crossbar)
The value must contain between 17 and 255 characters.
Version : Set the release information for the program
xmlns: Air namespace, each version of air will have a different namespace.
Define program name, title, description, Copyright and installation directory
Name : application names, which must be defined
<name>TestApp</name>
In Windows, this value is displayed in the title bar of the program
title (optional): displayed in the Air program installer
<title>testapp from Adobe Systems inc.</title>
description (optional) Show when air program is installed
<description>an MP3 player.</description>
Copyright (optional) Copyright information for air programs
<copyright>copyright©2006 [YourCompany, Inc.] </copyright>
installfolder (optional) subdirectories of the default installation directory
<installFolder>Acme</installFolder>
In Windows, the default installation subdirectory is the program Files directory, which is the/applications directory in Mac OS. For example, if the installation directory property is "ACME" and the program name is "Exampleapp", the program will be installed in C:/Program files/acme/example.
Use a backslash (/) as the directory delimiter:
<installfolder>acme/power tools</installfolder>
The Installfolder property can contain any Unicode (UTF-8) characters, except for the following:
Code
Character Hex Code
Various 0x00-x1f
* X2A
"X22
: x3a
> x3c
< x3e
? x3f
/x5c
| x7c
Defining rootcontent Elements
Application.xml also indicated the rootcontent file because the file was the first one to be loaded by the program. Whether it is a SWF or an HTML file.
The Rootcontent element value is a URL, relative to the path where the Application.xml file is located, such as the airtunes.swf file and the Application.xml file in the following rootcontent element in the same directory:
Code <rootcontent systemchrome= "None" Transparent= "true" visible= "true" height= "+" width= "> airtunes.swf" </rootContent>
The property value of the Rootcontent element primarily sets the properties of the window that will be created.
systemchrome: If set to standard, the window inherits the operating system window style, the program is not transparent, and if set to false, the window does not inherit the operating system window style. When you use the Flex Windowedapplication component, the component applies its own window style.
Transparent: set to True, the window supports alpha blending, the Transprent property is not changed after the window is created, and transparent windows require more memory and render slower.
Important: You can only set transparent= "true" when Systemchrome= "none".
visible: set to False to cause the window to be hidden after it is created.
You may need to hide the main window when it is created, and then set the position and size to true by the Stage.window.visible property. The main window is displayed again.
Height , Width: The height and width of the main window.
Specify icon file
The Icon property specifies one or more icons files that can be used, which is optional, and the operating system displays the default icon, even if it is not specified.
The icon path is relative to the program's root directory, PNG, GIF, and JPEG formats are supported
<icon> <image16x16>icons/smallIcon.png</image16x16> <image32x32>icons/mediumIcon.jpg< /image32x32> <image48x48>icons/bigIcon.gif</image48x48> <image128x128>icons/biggesticon.png </image128x128> </icon>
Note: The icon is not automatically added to the air package.
signaling the inclusion of an update interface
In general, AIR is installed and upgraded using the default installation dialog box, but you can define your own method to use the AIR Updater API to update the program, so you must add the handleupdates element to the description file:
Registering file Types
The FileTypes property specifies that those types will be registered:
<fileTypes> <fileType> <name>adobe. videofile</name> <extension>avf</extension> <description>adobe Video file</description > <contentType>application/vnd.adobe.video-file</contentType> </fileType> </fileTypes>
new features from Adobe Air
This section provides an overview of the new features of air.
New run-time classes
New features for run-time classes
The new monitoring Servo class
New run-time Class (runtime classes)
Here are the new run-time classes from Adobe Air that are not available for SWF running in your browser:
Clipboard flash.desktop clipboardformats flash.desktop compressionalgorithm flash.utils Clipboardtransfermode Flash.desktop dockicon flash.display dragactions flash.desktop dragmanager flash.desktop DragOptions flash.desktop Drmauthenticateevent flash.events drmstatusevent flash.events encryptedlocalstore flash.filesystem File Flash.filesystem filelistevent flash.events FileMode flash.filesystem FileStream flash.filesystem HTMLControl flash.html htmlhistoryitem flash.html htmlhost flash.html htmlpdfcapability flash.html Htmluncaughtjavascriptexceptionevent flash.html htmlwindowcreateoptions flash.html Icon flash.desktop Interactiveicon flash.display invokeevent flash.events javascriptfunction flash.html JavaScriptObject flash.html Nativedragevent flash.events nativemenu flash.display nativemenuitem flash.display NativeWindow flash.display Nativewindowboundsevent flash.events nativewindowdisplaystate Flash.display nativewindowdisplaystateevent Flash.events nativewindowerrorevent FLASH.EVents Nativewindowicon flash.display nativewindowinitoptions flash.display nativewindowresize flash.display Nativewindowsystemchrome flash.display nativewindowtype flash.display notificationtype flash.display Outputprogressevent flash.events screen flash.display Shell flash.system sqlcollationtype flash.data Sqlcolumnnamestyle flash.data sqlcolumnschema flash.data SQLConnection flash.data SQLError flash.errors SQLErrorCode Flash.errors sqlerrorevent flash.events sqlerroroperation flash.errors sqlevent flash.events SQLIndexSchema flash.data Sqlresult flash.data sqlschema flash.data sqlschemaresult flash.data sqlstatement flash.data SQLTableSchema flash.data Sqltransactionlocktype flash.data sqltriggerschema flash.data sqlupdateevent flash.events SQLViewSchema flash.data Systemtrayicon flash.display Updater flash.system urlrequestdefaults flash.net xmlsignaturevalidator flash.utils Transferabletransfermode flash.desktop urlrequestdefaults flash.net Updater Flash.system
Most classes are available only in the Air program security sandbox, but the following classes can also be used on top of other sandboxes:
Door
URLRequest.
What's new in the run-time class
The following classes can be used on browsers, but there are additional properties and methods available under air:
Httpstatusevent http_response_status responseurl responseheaders urlrequest followredirects manageCookies Shouldauthenticate shouldcacheresponse useragent usercache setlogincredentials () URLStream Httpresponsestatus Event Stage NativeWindow Security Application
Most of these properties and methods are used in the Air program security Hourglass, but the URLRequest class can also be used in other security sandboxes.
The Bytearray.compress () and Bytearray.uncompress () methods contain a new algorithm parameter that allows you to select compression or zlib compression.
New Flex Components
The following flex components are available when the air program is developed:
Fileevent filesystemcombobox filesystemdatagrid filesystemenumerationmode Filesystemhistorybutton FileSystemList Filesystemsizedisplaymode Filesystemtree HTML windowedapplication
monitoring Servo class
The Air.net package contains some network monitoring classes that can be used only in Adobe Air and require the introduction of SERVICEMONITOR.SWC files.
The package contains the following classes:
Servicemonitor
Socketmonitor
URLMonitor