WHAT YOU WILL LEARN IN THIS CHAPTER:
In this chapter you'll take a look at some of the elements involved in constructing AIR apps, outside the task of actually coding an application.
First, you'll explore the core components of the AIR application descriptor file, understanding how to specify settings for it, covering image icon assignment, and setting Android permissions and specifying iOS settings.
You'll close the chapter by packaging a mobile application using Flash Builder, and then look at how you can update AIR applications that aren't uploaded to a target platform's marketplace.
An Adobe AIR application descriptor file contains parameters that are used to identify, install, and launch an AIR application.
Each new project created in Flash Builder automatically generates an AIR application descriptor file template. The AIR application descriptor file name is usually generated by the name of the application set in the Flash Builder New Project wizard, as covered in Chapter 2, in which HelloWorldApp generates HelloWorldApp-app.xml.
This section takes a look at editing an application descriptor file focusing on each of the core elements.
The AIR application descriptor file is essentially an XML file consisting of many elements that you need to specify for your mobile applications to be built. When these are packaged and then deployed to the mobile device, the installation of AIR on that device can interpret the package correctly and ascertain where to install files, write directories, and set data. Some of the elements in the application descriptor file are required, and some are optional.
In Table 3-1 you see each of the core elements used in the AIR application descriptor file for mobile applications listed.
ELEMENT | USAGE |
<application> | Sets the AIR namespace declaration. Required for building AIR apps. |
<id> | A unique identity for the application. |
<filename> | The name used for the Android Package file (APK, .apk file). |
<name> | Sets the application name displayed on the device. |
<versionNumber> | The version number of the application. |
<versionLabel> | Used to display a label to users in the application's installation dialog. |
<initialWindow> | Contains properties for the initial appearance of the application. |
<content> | To set the path to the main content .swf file of the application. |
<visible> | To set the visibility of the content. |
<fullScreen> | Defines whether the application should use the entire screen of the device. |
<aspectRatio> | To specify whether the application is in portrait or landscape mode. |
<autoOrients> | To set whether the orientation of content in the application automatically reorients as the device changes orientation. |
<supportedProfiles> | Defines the supported profile that best fits the type of AIR application. |
<icon> | To specify the icon images used to launch the application. |
Next you edit the contents of HelloWorldApp-app.xml, the AIR application descriptor file that can be found in the src folder of the Hello World App project from Chapter 2. Here are the steps:
LISTING 3.1: Setting the XML declaration in the Hello World App AIR application descriptor file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
NOTE When Flash Builder generates HelloWorldApp-app.xml, it will contain numerous comments for properties used for AIR desktop applications that we're not going to cover here. Nevertheless, those comments would be self-explanatory if you were to read them. Thus, clearing the contents of HelloWorldApp-app.xml will make it easier to convey some of the settings and their corresponding values.
The recommended form for the AIR application's ID is a dot-delimited, reverse-DNS-style string, as shown in the following snippet:
<id>com.wrox.ch3.AppName</id>
WARNING Each new application you install on a device should have a unique ID associated with it. If it doesn't, chances are it will override an existing application with the same ID.
The <name> property in the AIR application descriptor file is used for display purposes. It is the label the end user will see once the application has been installed on the user's mobile device. While the <filename> property is used for the actual file name and file path on the device, it is usually hidden from the end user's view. The value for the filename should be a string with no spaces.
LISTING 3.4: Setting the Name and Filename properties in the Hello World App AIR application descriptor file
<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/2.7"> <id>com.wrox.ch3.HelloWorldApp</id> <filename>HelloWorldApp</filename> <name>Hello World App</name>
The <versionNumber> property is required to identify an instance of the application installed on the device. The version number's representation should be a numerical value that incrementally changes each time an update or new release of the mobile application has been produced, since the version number can be used to distinguish between applications that have the same <id> values in their AIR application descriptor files.
Version numbers should contain three integers separated by periods, as shown in the following snippet:
<versionNumber>7.3.6</versionNumber>
The three integers represent the major, minor, and revision numbers assigned for the application's release. These usually refer to an automated build of the application. Each value should be between 0 and 999.
LISTING 3.5: Setting the Version Number property in the Hello World App AIR application descriptor file
<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/2.7"> <id>com.wrox.ch3.HelloWorld</id> <filename>HelloWorldApp</filename> <name>Hello World App</name> <versionNumber>0.9.0</versionNumber>
You can also supply the version as a label via the <versionLabel> element, as shown in the following snippet:
<versionLabel>0.9.0 (BETA)</versionLabel>
The <versionNumber> is required and takes precedence over the <versionLabel>, and if <versionLabel> is not used, then the value set in <versionNumber> is displayed to users.
Three values can be supplied to <supportedProfiles> for AIR applications:
For AIR mobile applications, you need to set <supportedPropfiles> to the mobileDevice profile.
LISTING 3.6: Setting the Supported Profiles property in the Hello World App AIR application descriptor file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/2.7">
<id>com.wrox.ch3.HelloWorldApp</id>
<filename>HelloWorld</filename>
<name>Hello World App</name>
<versionNumber>0.9.0</versionNumber>
<supportedProfiles>mobileDevice</supportedProfiles>
Several properties can define the initial appearance of the application when it starts up: the content path; whether the content is visible; whether it is showing full-screen; the initial screen orientation; and whether the application changes to a landscape or portrait orientation when the user rotates the device.
The <initialWindow> element of the AIR application descriptor file is what defines these properties. Here you can specify the <content>, <visible>, <fullScreen>, <aspectRatio>, and <autoOrients> elements to specify the properties for the initial appearance of the application.
In the following snippet, the HelloWorldApp.swf is specified at the <content> property, the <visible> property is set to true, <fullScreen> is set to true, <aspectRatio> is set to landscape, and the <autoOrients> property is set to false:
<initialWindow> <content>HelloWorldApp.swf</content> <visible>true</visible> <fullScreen>true</fullScreen> <aspectRatio>landscape</aspectRatio> <autoOrients>false</autoOrients> </initialWindow>
The last two properties set by <aspectRatio> and <autoOrients> indicate that the application will always be in landscape mode, since the application is prevented from automatically changing its orientation. Device orientation is covered in greater detail in Chapter 5.
LISTING 3.7: Setting the Initial Window properties in the Hello World App AIR application descriptor file
<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/2.7"> <id>com.wrox.ch3.HelloWorldApp</id> <filename>HelloWorldApp</filename> <name>Hello World App</name> <versionNumber>0.9.0</versionNumber> <supportedProfiles>mobileDevice</supportedProfiles> <initialWindow> <content>HelloWorldApp.swf</content> <visible>true</visible> <fullScreen>false</fullScreen> <aspectRatio>portrait</aspectRatio> <autoOrients>false</autoOrients> </initialWindow>
The launch icon for an application needs to be specified before packaging. Because devices across platforms tend to have different screen resolutions, you need to be very specific about the images you reference. Thus, icon or image size needs to be carefully considered. For the Google Android and Apple iOS platforms, you set paths to the application icons in the AIR application descriptor file. For the BlackBerry Tablet OS platform, you specify the icon in the BlackBerry Tablet settings file, which will be covered in more detail later.
For the BlackBerry PlayBook, the application icon should be supplied as a single 86×86 pixel .png image file that is an image with an 86 pixel width and 86 pixel height.
On Android devices, the icon should be supplied as 36×36, 48×48, and 72×72 pixel .png file images. These icon sizes are used for low-, medium-, and high-density screens, respectively.
On the iPad, iPhone, and iPod Touch iOS devices, there are a number of different screens on the platform that require different sized icons to be packaged for an application. The following details the sizes that can be supplied and where they are used:
The following snippet shows the <icon> declaration in the AIR application descriptor file that specifies the path to each of the image files that can be used on Android and iOS devices:
<icon> <image29x29>assets/i29x29.png</image29x29> <image36x36>assets/i36x36.png</image36x36> <image48x48>assets/i48x48.png</image48x48> <image57x57>assets/i57x57.png</image57x57> <image72x72>assets/i72x72.png</image72x72> <image114x114>assets/i114x114.png</image114x114> </icon>
The images are located in a folder called assets, in a folder relative to the content and main .swf file. Notice that for each image you need to use a different element in the AIR application descriptor file. For example, to specify a 72×72 pixel file image that can be used for the Home screen of an iPad and a Google Nexus One, the path to the image is specified in the <image72x72> tag.
If you do not supply an icon of a given size, the next largest size is used and scaled to fit the occupied space. For example, on a Google Android device, if the <image36x36> icon is not specified, the <image48x48> declaration is used, and if <image48x48> isn't set, the application will default to <image72x72>.
If you don't specify any of the image icons permitted, or if you incorrectly specify the path to an image, you will see a default application image icon for the application set by the OS.
NOTE For the remaining chapters, the defining of properties in the AIR application descriptor file process is omitted, so you may notice when you install the examples on Android devices that the default system icon is used.
Figure 3-1 shows the default Google Android application icon you will see on the device in the three sizes.
Figure 3-2 shows the six application icons that will be used in the Hello World App project.
You should notice that once you've added the images and the assets folder, the bin-debug folder gets automatically replicated. Later you'll see a bin-release folder created and used for the final export of the AIR application.
LISTING 3.8: Setting the Icon properties in the Hello World App AIR application descriptor file
<initialWindow> <content>HelloWorldApp.swf</content> <visible>true</visible> <fullScreen>false</fullScreen> <initialOrientation>portrait</initialOrientation> <autoOrients>false</autoOrients> </initialWindow> <icon> <image36x36>assets/air36x36.png</image36x36> <image48x48>assets/air48x48.png</image48x48> <image57x57>assets/air57x57.png</image57x57>
Referencing the five images, as shown here, will allow application icons to be shown for both Google Android and Apple iOS.
For Android applications the security model for the OS requires that each application requests a particular permission in order to use a feature that has security or privacy implications. These permissions cannot be requested or changed at run time and so must be requested when the application is packaged in the AIR application descriptor file.
When a user installs an Android application, the operating system informs the user which permissions an application is requesting.
Android permissions are specified inside the <android> element of the AIR application descriptor file.
In the following snippet, you'll see that the android:name attribute inside the <uses-permissions> element is specified as the value android.permission.NAME, representing the full name of an Android permission.
<android>
<manifestAdditions>
<manifest>
<data>
<![CDATA[
<uses-permission android:name=“android.permission.NAME”/>
]]>
</data>
</manifest>
</manifestAdditions>
</android>
Each of the uses-permission statements in the AIR application descriptor file is added directly to an Android manifest document, when you target the Google Android platform in the New Flex Mobile Project wizard, as covered in Chapter 2.
The following lists some of the permissions that are required by AIR Android apps, in order for an application to use particular mobile device features:
So, for example, to allow an application to use the camera you would use the android.permission.CAMERA Android permission, as shown in the following snippet:
<android>
<manifestAdditions>
<manifest>
<data>
<![CDATA[
<uses-permission android:name=“android.permission.CAMERA”/>
]]>
</data>
</manifest>
</manifestAdditions>
</android>
NOTE Throughout this book different AIR application descriptor files will be in use, and depending on the application covered, the file will contain a different value for each of the settings. For instance, in Chapter 10 you need to use the ACCESS_FINE_LOCATION, CAMERA, INTERNET, and RECORD_AUDIO Android permissions.
LISTING 3.9: Setting an empty Android permissions declaration in the HelloWorld AIR application descriptor file
<initialWindow> <content>HelloWorldApp.swf</content> <visible>true</visible> <fullScreen>false</fullScreen> <initialOrientation>portrait</initialOrientation> <autoOrients>false</autoOrients> </initialWindow> <icon> <image36x36>assets/air36x36.png</image36x36> <image48x48>assets/air48x48.png</image48x48> <image57x57>assets/air57x57.png</image57x57> <image72x72>assets/air72x72.png</image72x72> <image114x114>assets/air114x114.png</image114x114> </icon> <android> <manifestAdditions> <![CDATA[ <manifest/>
For iOS, you set application settings inside the <iPhone> element of the AIR application descriptor file.
There are a numerous key-value pairs that define particular settings for your application running on iOS. These need to be set within the child element <InfoAdditions>. The following lists commonly used keys and some of their associated values:
Setting the <requestedDisplayResolution> to high allows you to specify that the application should utilize the full 940 x 640 retina display. This should be set when you want to target iPhone 4, as shown in the following snippet:
<requestedDisplayResolution>high</requestedDisplayResolution>
By default, this property is set to standard, which means the device screen will appear to your application as a standard resolution screen of 480 x 320. The application will try to adapt and upscale a single pixel in standard mode to four equivalent pixels on the high-resolution screen, giving a blurred appearance.
On non-high resolution iOS devices, if the <requestedDisplayResolution> property is set to high, the value is ignored and the application defaults to the standard setting.
LISTING 3.10: Setting iOS capabilities for the Hello World App in the AIR application descriptor file
<icon> <image36x36>assets/air36x36.png</image36x36> <image48x48>assets/air48x48.png</image48x48> <image57x57>assets/air57x57.png</image57x57> <image72x72>assets/air72x72.png</image72x72> <image114x114>assets/air114x114.png</image114x114> </icon> <android> <manifestAdditions> <![CDATA[ <manifest/> ]]> </manifestAdditions> </android> <iPhone> <InfoAdditions> <![CDATA[ <key>UIDeviceFamily</key> <array> <string>1</string> </array> <key>UIStatusBarStyle</key> <string>UIStatusBarStyleBlackTranslucent</string> <key>UIPrerenderedIcon</key> <string>YES</string> ]]> </InfoAdditions> <requestedDisplayResolution>high</requestedDisplayResolution> </iPhone>
You've now covered each of the settings required for a valid AIR application descriptor file to run on Google Android and Apple iOS devices. Later you'll you'll take a look at exporting a release package for the application, using this descriptor file via Flash Builder. In the final section on updating AIR applications you also reference several values saved to the file, in particular the <versionNumber> property. Next take a look at the configuration settings required for BlackBerry Tablet OS.
The configuration settings for BlackBerry Tablet OS are found in the blackberry-tablet.xml file, which is generated when you choose to include the BlackBerry Tablet OS as a target platform during project setup. In this file you can specify a number of settings and permissions, which are used in addition to the AIR application descriptor file settings and permissions.
QNX is the platform on which the BlackBerry Tablet OS is based. By default, the XML file simply has an <?xml> declaration and an empty <qnx/> node:
<?xml version="1.0" encoding="UTF-8"?> <qnx/>
The <qnx> element must have nested elements defined to set the appearance and behavior of the application on the device. The following code snippet shows an example of a configuration file:
<?xml version="1.0" encoding="UTF-8"?> <qnx> <author>jganderson</author> <authorId>gYAAgFbt6rihu</authorId> <category>core.media</category> <buildId>1</buildId> <platformVersion>1.0.0.0</platformVersion> <icon> <image>i86x86.png</image> </icon> <splashscreen>s600x1024.jpg:s1024x600.jpg</splashscreen> <permission>access_internet</permission> </qnx>
The following sections cover each of the core elements.
The <author> and <authorId> values need to match the values specified in the debug token generated for the device.
The <buildId> is a value that represents an incremental build number for your application, which needs to be a whole number. It is combined with the <versionNumber> element of the AIR application descriptor file, which holds the (Major).(Minor).(Revision) values, and represents the build portion of a full version number reference in (Major).(Minor).(Revision).(Build).
The <platformVersion> is the minimum version of the BlackBerry Tablet OS required to run the application. If this number exceeds the number on the device, it won't install.
The following snippet gives an example of how both these elements should be set:
<buildId>1</buildId> <platformVersion>1.0.6.2390</platformVersion>
Note that the 1.0.6.2390 value specified for the <platformVersion> here is the version of the BlackBerry Tablet OS that had AIR version 2.7.0195 installed.
On a BlackBerry PlayBook device, there are four categories in which you'll find applications: All, Favorites, Media, and Games.
Every applications installed on the PlayBook appears under the All category. Setting the <category> field in the settings file also allows you to add the application's launch icon to either the Media or Games categories. Specifying core.games adds the application to Games, while setting to core.media adds the application to the Media section, as shown in the following snippet:
<category>core.media</category>
This configuration setting is optional.
As previously mentioned, you need to define only one application icon in the configuration file for the BlackBerry PlayBook, which needs to be 86px width by 86px height. This is specified as shown in the following snippet:
<icon>
<image>assets/i86x86.png</image>
</icon>
This configuration setting is also optional.
WARNING The list of icons specified in the AIR application descriptor file override the icon set in the BlackBerry Tablet Settings file. To use your 86×86 icon set in the BlackBerry Tablet settings file, you need to remove those specified in the AIR application descriptor.
The following lists some of the permissions that need to be added in the configuration settings, in order for an application to use particular device features on BlackBerry Tablet OS:
Permissions are set through the either the <permission> or <action> element of the BlackBerry Tablet OS configuration file.
The following snippet shows how to allow an application to use network services and access GPS data:
<permission>access_internet</permission> <permission>read_geolocation</permission>
Like with the Google Android platform, permissions can be automatically added to the configuration file when you target the BlackBerry Tablet OS in the New Flex Mobile Application wizard, as covered in Chapter 2.
These configuration settings are optional, but bear in mind if they are not set, you may run into issues not being able to use particular features in your applications.
While the application is loading you can display an image, known as the splash screen image.
The application can potentially run in both landscape and portrait orientation, so you are able to specify a value representing two images in the <splashscreen> element.
The screen size of the BlackBerry PlayBook is 1024 x 600. In the following snippet, you see the value for <splashscreen> is separated by a colon (:). The first image path, s1024x600.jpg, before the colon, represents the splash image to be shown when the application is in a landscape orientation. The second image path following the colon, s600x1024.jpg, represents the splash image to be shown when the image is in a portrait orientation.
<splashscreen>s1024x600.jpg:s600x1024.jpg</splashscreen>
If only a single image is specified, the device will default to that image, regardless of the size. Remember, though, setting the <autoOrients> and <initialOrientation> properties in the AIR application descriptor file will allow you to control the orientation of the application on launch; so, you could potentially get away with setting one splash image in a situation where your application will only use one orientation.
Also be aware that a splash screen image can also be specified for Flex mobile applications in the main application file. In the following code snippet you see a splash .png image is set to display for 5 seconds before the application launches:
<?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.HelloWorldAppHome" splashScreenImage="@Embed('assets/splash.png')" splashScreenMinimumDisplayTime="5000" splashScreenScaleMode="none"> </s:ViewNavigatorApplication>
If this were to be set in addition to the <splashscreen> setting, you would have two splash images displayed, with the BlackBerry Tablet OS splash image showing first.
Before moving onto the next section, ensure the blackberry-tablet.xml file for the Hello World App project is updated with the configuration settings specified in Listing 3-11.
LISTING 3.11: Configuration settings for the Hello World BlackBerry Tablet OS Configuration File
<?xml version="1.0" encoding="UTF-8"?> <qnx> <author>authorName</author> <authorId>authorId</authorId> <category>core.media</category> <buildId>1</buildId> <platformVersion>1.0.0.0</platformVersion> <icon> <image>assets/air86x86.png</image> </icon> </qnx>
Note that in Listing 3-11 you will need to replace authorName and authorId with your own values for deploying to a device that has a debug token installed.
Using Flash Builder, you can package native AIR Android applications via the Export Release Build panel.
Packaging applications requires you to use self-signed digital certificates, which associate the application with an identity, with the aim of forging a trust between the application's creator and an end user. A few of the following steps will reference the creation of a self-signed digital certificate for use with packaging an AIR Android application.
The native application file package for Android is a .apk file. At the end of this section, you should be able to install the Hello World App onto an Android device.
As you will see in Figure 3-13, the newly generated HelloWorldApp.apk file will be located alongside the project's src folder. You may also see a new folder called bin-release, which contains all the files for the package.
If you have an Android device, try connecting it to Flash Builder via USB and then use the export release function to install the application onto the device. Figure 3-14 shows the app installed on the home screen.
The native application file package for the Apple iOS platform is an .ipa file. At the end of this section, you should be able to install the Hello World App onto an iPhone 4.
Follow the next steps to create a release version of Hello World App using Flash Builder:
NOTE At this stage, you will probably notice that the application icon for ITunes doesn't have an icon. In the AIR application descriptor file, you will need to specify an image that is 512x512 for the <image512x512> property.
You can also navigate to the Spotlight screen and search for the Hello World App and find the application there, too (Figure 3-22).
At this point, realize that the settings defined in the AIR application descriptor file for iOS, while subtle, are significant. If you remember setting the <UIPrerenderedIcon> to YES earlier, then take notice of the gloss that was removed from the default setting, as shown in Figure 3-23.
Also, if you have already run the application on the iPhone 4 without making the changes in this chapter, you will see the difference from the previous chapter — that the <requiredDisplayResolution> setting has made in fully utilizing the screen resolution. Figures 3-24 through 3-26 show the Hello World App in action.
For the remaining chapters, you will need to repeat the steps learned here to package applications for iOS devices.
The native application file package for BlackBerry Tablet OS is a .bar file. At the end of this section, you should be able to create a release package for the Hello World App onto a BlackBerry PlayBook.
Follow the next steps to create a release version of Hello World App for the BlackBerry PlayBook using Flash Builder:
Figure 3-30 shows the Hello World App installed on the BlackBerry PlayBook under the Media category.
In this chapter, you've explored targeting each of the platforms supporting AIR mobile applications. For more information, I recommend visiting each platform's Mobile and Devices Developer Center page on Adobe's website:
Updating your application involves your amending the <versionNumber> value in the application descriptor file, repackaging the application to the native platform, and uploading the new version of the application to the target marketplace. For Android, this is the Android Market or Amazon Appstore; for BlackBerry, it's AppWorld; and for Apple, it's App Store.
The process of updating an application installed on a device is simple enough for marketplaces and usually the process is automatic. However, when you download a mobile application from the Android marketplace, you can select whether or not to have automatic updates, where you will be notified when an updated version is available. The user could potentially decide to avoid using the marketplace to grab the update, choosing to manually check for new versions. In this scenario, there is a way you can notify users within an application that there is an upgrade available, when they haven't requested automatic updates.
Presenting a user with an update notification in the mobile app involves adding code to your application that uses namespaces to retrieve the descriptor file details and then compares those details with a reference to the new version.
The first step is to programmatically retrieve the version number from the application descriptor file. The following snippet shows how to use the NativeApplication class to retrieve an AIR application's descriptor file and assign the applicationDescriptor property to a variable called xmlObj of XML type:
var xmlObj:XML = NativeApplication.nativeApplication.applicationDescriptor;
Once the application descriptor's XML has been assigned to the variable, the Namespace class can be used to retrieve particular values in the XML file, as shown in the following snippet, where the application id and version number are retrieved and assigned to variables id and currentVersion respectively:
var xmlObj:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = xmlObj.namespace(); var appId:String = xmlObj.ns::id; var currentVersion:String = xmlObj.ns::versionNumber;
As previously mentioned, to create an updated release version of your mobile application you will need to update the version number in the application descriptor file.
Using the preceding code snippet, the application can check the value of the version number and present the user with a message to indicate there is an update available.
In the following snippet the variable newVersion is assigned the value 1.0.1, a number that represents the new version number for an application. This should be different from the value retrieved from the one present in the application descriptor; you'll recall that earlier, the <versionNumber> property was set to 0.9.0:
var xmlObj:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = xmlObj.namespace(); var appId:String = xmlObj.ns::id; var currentVersion:String = xmlObj.ns::versionNumber; var newVersion:String = "1.0.1"; if(currentVersion != newVersion) { // The version numbers are not the same... // Present the user with an update... } else { // The version numbers are the same... // No need to present the user with an update... }
Here the if statement uses the currentVersion value, retrieved from the descriptor file, and checks that number against the value held by the newVersion variable.
The code within the if statement is simply a comment which indicates what can be done.
Essentially the newVersion number should be retrieved from a file residing on a server which can be updated whenever a new release of the application is available.
For this you would have to use the URLLoader class to load in the data from a file on the server. Working with data is covered in detail in Chapter 8.
This chapter took a detailed look at building applications that target the Google Android, BlackBerry Tablet OS, and Apple iOS platforms, noting the contents of the AIR application descriptor file, specifying the image icons, setting Android and BlackBerry permissions, and packaging applications.
In the next chapter, you will look at touch, multitouch, and gestures, some of the key features introduced in Flash Player 10.1.
Once you have completed some of the following chapters, you may want to return here to package some of the example applications using the steps listed in the walk-through.
WHAT YOU LEARNED IN THIS CHAPTER
TOPIC | KEY CONCEPT |
AIR application descriptor files | Be aware of each of the required elements in the AIR application descriptor file. |
Application IDs | Use reverse-DNS style strings to uniquely identify your application via the Application ID — for example, com.wrox.ch3.HelloWorldApp. |
Application's initial appearance | To define the initial appearance of the application when it launches, define the <initialWindow> element.
Use the <content>, <visible>, <fullScreen>, <aspectRatio>, <initialOrientation>, and <autoOrients> elements to set the initial appearance of the application. |
Launch icons | To set an application's icons, define the <icon> element.
Three image sizes are used on Android: 36x36, 48x48, and 72x72. Five image sizes are used across Apple iOS devices: 29x29, 57x57, 72x72, and 114x114, and 512x512. One image size is used on BlackBerry Tablet OS: 86x86. |
Platform configurations | For the Google Android platform, define the configuration settings within the <android> element of the AIR application descriptor file.
For the Apple iOS platform, define the configuration settings within the <iphone> element. For the BlackBerry Tablet OS platform, define the configuration settings within the <qnx> element of the blackberry-tablet.xml file. |
Setting permissions | For Google Android, define the <uses-permission> element to manually define each permission that your application uses.
For BlackBerry Tablet OS, define the <permissions> element in the blackberry-tablet.xml file to manually define each permission that your application uses. For Apple iOS, no permissions are defined. |
Packaging applications | In Flash Builder, use the Export Release Build Panel to generate release packages.
The Google Android platform uses an .apk file package. The Apple iOS platform uses an .ipa file package. The BlackBerry Tablet OS uses a .bar file package. |
Updating AIR mobile applications | Use the NativeApplication class to retrieve details from the AIR application descriptor file.
Use the <versionNumber> property as an indicator to decipher whether the user needs to be informed of an upgrade. |
3.129.25.231