An extension descriptor file describes the contents of a native extension package.
The following extension descriptor document describes a native extension for:
-
an Android device
-
a default ActionScript implementation for other platforms
com.example.MyExtension 0.0.1 MyExtension.jar com.sample.ext.MyExtension
The extension descriptor file is an XML document with the following structure:
<extension xmlns="http://ns.adobe.com/air/extension/2.5">
<id>...</id>
<versionNumber>...</versionNumber>
<name>
<text xml:lang="language_code">...</text>
</name>
<description>
<text xml:lang="language_code">...</text>
</description>
<platforms>
<platform name="device">
<applicationDeployment>
<nativeLibrary>...</nativeLibrary>
<initializer>...</initializer>
<finalizer>...</finalizer>
</applicationDeployment>
</platform>
<platform name="device">
<deviceDeployment/>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
The following dictionary of elements describes each of the legal elements of an AIR application descriptor file.
Declares a native code library included in the extension package and, hence, deployed with the application.
Each platform
element must contain either the applicationDeployment
element
or the deviceDeployment
element, but not both.
Parent elements:
Child elements:
Identifies the native code library and the initialization and finalization
functions. When the platform name is default
, the applicationDeployment
element has no child elements because the default
platform has no native code
libraries.
<applicationDeployment>
<nativeLibrary>myExtension.so</nativeLibrary>
<initializer>com.example.extension.Initializer</initializer>
<finalizer>com.example.extension.Finalizer</finalizer>
</applicationDeployment>
A copyright declaration for the extension.
Parent elements:
Child elements:
none
A string containing copyright information.
<copyright>© 2010, Examples, Inc. All rights reserved.</copyright>
The description of the extension.
Parent elements:
Child elements:
Use a simple text node or multiple text
elements.
Using multiple text
elements, you can specify multiple languages in the
description
element. The xml:lang
attribute for each text element specifies
a language code, as defined in RFC4646.
Description with simple text node:
<description>This is a sample native extension for Adobe AIR.</description>
Description with localized text elements for English, French, and Spanish:
<description>
<text xml:lang="en">This is a example.</text>
<text xml:lang="fr">C'est un exemple.</text>
<text xml:lang="es">Esto es un ejemplo.</text>
</description>
Declares a native extension for which the code libraries are deployed separately on the device and are not included in this extension package.
Device deployment is not supported by all platforms.
Each platform
element must contain either the applicationDeployment
element
or the deviceDeployment
element, but not both.
Parent elements:
Child elements:
None.
None. The deviceDeployment
element must be empty.
<deviceDeployment/>
The root element of the extension descriptor document.
Parent elements:
None.
Child elements:
Identifies the supported platforms and the code libraries for each platform.
The extension
element contains a namespace attribute called xmlns
. Set the
xmlns
value to one of the following values:
xmlns="http://ns.adobe.com/air/extension/3.1"
xmlns="http://ns.adobe.com/air/extension/2.5"
The namespace is one of the factors, along with the SWF version, that determines compatibility between an AIR SDK and an ANE file. The AIR application must be packaged with a version of the AIR SDK that equals or exceeds the extension namespace. Thus an AIR 3 application can use an extension with the 2.5 namespace, but not the 3.1 namespace.
<extension xmlns="http://ns.adobe.com/air/extension/2.5">
<id>com.example.MyExtension</id>
<versionNumber>1.0.1</versionNumber>
<platforms>
<platform name="Polyphonic-MIPS">
<deviceDeployment/>
</platform>
<platform name="NeoTech-ARM">
<deviceDeployment/>
</platform>
<platform name="Philsung-x86">
<deviceDeployment/>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
The finalization function defined in the native library.
Parent elements:
Child elements:
None.
The name of the finalizer function if the extension uses the C API in its native library.
If the extension uses the Java API, this element contains the name of the class that implements the FREExtension interface.
The value can contain these characters: A - Z, a - z, 0 - 9, period (.), and dash (-).
<finalizer>...</finalizer>
The ID of the extension.
Parent elements:
Child elements:
None.
Specifies the ID of the extension.
The value can contain these characters: A - Z, a - z, 0 - 9, period (.), and dash (-).
<id>com.example.MyExtension</id>
The initialization function defined in the native library. An initializer
element is required if the nativeLibrary
element is used.
Parent elements:
Child elements:
None.
The name of the initialization function if the extension uses the C API in its native library.
If the extension uses the Java API, this element contains the name of the class that implements the FREExtension interface.
The value can contain these characters: A - Z, a - z, 0 - 9, period (.), and dash (-).
<initializer>...</initializer>
The name of the extension.
Parent elements:
Child elements:
If you specify a single text node (instead of multiple <text>
elements), the
AIR application installer uses this name, regardless of the system language.
The xml:lang
attribute for each text element specifies a language code, as
defined in RFC4646.
The following example defines a name with a simple text node:
<name>Test Extension</name>
The following example, specifies the name in three languages (English, French, and Spanish) using <text> element nodes:
<name>
<text xml:lang="en">Hello AIR</text>
<text xml:lang="fr">Bonjour AIR</text>
<text xml:lang="es">Hola AIR</text>
</name>
The native library file included in the extension package for a platform. Consider the following:
-
The
nativeLibrary
element is not required if the extension contains only ActionScript code. -
If the
nativeLibrary
element is not used, theinitializer
andfinalizer
elements cannot be used either. -
If the
nativeLibrary
element is used, theinitializer
element is also required.
Parent elements:
Child elements:
None.
The filename of the native library included in the extension package.
The value can contain these characters: A - Z, a - z, 0 - 9, period (.), and dash (-).
<nativeLibrary>extensioncode.so</nativeLibrary>
Specifies the native code library for the extension on a specific platform.
Parent elements:
Child elements:
One, and only one, of the following elements:
The name
attribute specifies the name of the platform. The special default
platform name allows the extension developer to include an ActionScript library
that simulates the behavior of the native code on unsupported platforms.
Simulated behavior can be used to support debugging and to provide fall back
behavior for multi-platform applications.
Use the following values for the name
attribute:
-
Android-ARM
for Android devices. -
default
-
iPhone-ARM
for iOS devices. -
iPhone-x86
for the iOS Simulator. -
MacOS-x86-64
for Mac OS X devices. -
QNX-ARM
for Blackberry Tablet OS devices. -
Windows-x86
for Windows devices. -
appleTV-ARM
for tvOS devices. -
appleTV-x86
for the tvOS Simulator.
Note: Device-bundled extensions use a
name
attribute value defined by the device manufacturer.
The child elements specify how the native code library is deployed. Application deployment means that the code library is deployed with each AIR application that uses it. The code library must be included in the extension package. Device deployment means that the code library is deployed separately to the platform and is not included in the extension package. The two deployment types are mutually exclusive; include only one deployment element.
<platform name="Philsung-x86">
<deviceDeployment/>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
Specifies the platforms supported by this extension.
Parent elements:
Child elements:
A platform
element for each supported platform. Optionally, a special
default platform can be specified containing an ActionScript implementation
for use on platforms not supported with a specific code library.
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
<nativeLibrary>MyExtension.jar</nativeLibrary>
<initializer>com.sample.ext.MyExtension</initializer>
<finalizer>com.sample.ext.MyExtension</finalizer>
</applicationDeployment>
</platform>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>MyExtension.a</nativeLibrary>
<initializer>InitMyExtension></initializer>
</applicationDeployment>
</platform>
<platform name="Philsung-x86">
<deviceDeployment/>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
<platform name="appleTV-ARM">
<applicationDeployment>
<nativeLibrary>MyExtension.a</nativeLibrary>
<initializer>InitMyExtension></initializer>
</applicationDeployment>
</platform>
</platforms>
Specifies a localized string.
The xml:lang
attribute of a text element specifies a language code, as defined
in RFC4646.
AIR uses the text
element with the xml:lang
attribute value that most
closely matches the user interface language of the user's operating system.
For example, consider an installation in which a text
element includes a value
for the en (English) locale. AIR uses the en name if the operating system
identifies en (English) as the user interface language. It also uses the en name
if the system user interface language is en-US (U.S. English). However, if the
user interface language is en-US and the application descriptor file defines
both en-US and en-GB names, then the AIR application installer uses the en-US
value.
If the application defines no text
element that matches the system user
interface languages, AIR uses the first name
value defined in the extension
descriptor file.
Parent elements:
Child elements:
none
An xml:lang
attribute specifying a locale and a string of localized text.
<text xml:lang="fr">Bonjour AIR</text>
The extension version number.
Parent elements:
Child elements:
none
The version number can contain a sequence of up to three integers separated by periods. Each integer must be a number from 0 to 999 (inclusive).
<versionNumber>1.0.657</versionNumber>
<versionNumber>10</versionNumber>
<versionNumber>0.01</versionNumber>