Quantcast
Channel: Flash Builder – Adobe AIR on Mobile

Using release swf for publishing AIR applications

$
0
0

Adobe tools like Flash Builder allow you to compile actionscript sources of your application and then package all the swf content and assets as .air, .ipa, .apk and native package formats.

This post is meant to stress on the importance of using Release version of swf file for packaging when you intend to publish it on an application store.

Why should I care to create the release version of a swf?

There are two major advantages of using the release version for publishing applications:

  • Application Size – The debug version of a swf contains lot of extra information which is required for debugging during development. As a result, the size of debug version of a swf is always more than the corresponding release version.
  • Memory Size – Because of extra information, an application with debug swf consumes way more memory than its corresponding release version. For a sample Flex app, the memory usage can go down from 22 MB to 14 MB if one switches to using release version of swf.
  • Application Performance – Some of the extra code embedded in a debug swf is actually executed during runtime, and so you might see performance gains with the release version of the swf.

If you are packaging your application for iOS, you would see some more improvements:

  • Application Packaging Time – If you are using ‘Standard Packaging’ mode (which generates native ARM code for your swf content), the packaging time depends on the amount of byte code available in the swf file. As a result, you would most likely see a significant drop in packaging time if you use release version of a swf.

With release version of swf, the reduction in application size is also much more prominent while packaging application for iOS.

How can I create the release version of a swf?

There are two ways to do this:

  • Use ‘Export Release Build’

This is the recommended way. In Flash Builder, select Project->Export Release Build, provide all the required information to package the application. This mechanism doesn’t actually put the release swf in some folder like ‘bin-release’, though it is actually packaged into the application package (.apk, .ipa etc.) file.

  • Use Compiler option (-debug=false)

In Flash Builder, add “-debug=false” in Project->Properties->Flex Compiler->Additional compiler arguments, and build the application. With this compiler option provided, swf created with any configuration would always be the release version. Clicking on ‘Run” or “Debug” would however create this release swf in the “bin-debug” folder. You can use this compiler option (i.e -debug=false) even if you are using mxmlc compiler on command line.


AIR iOS app packaging with Flash Tooling and AIR 3.3

$
0
0

If you are using iOS Native Extensions with AIR 3.3, you may find that your application does not get packaged when using Flash Builder/Flash Pro. This is because, when using native extensions, linker warnings are not suppressed, and Flash Builder/Flash Pro are not able to handle such large number of warnings, specifically on Windows. This issue will be fixed in the upcoming release of Flash Builder and Flash Pro.

In order to overcome this issue, you can include the platform descriptor file (platform.xml) in your ANE, which contains the following linker option:

<option>-w</option>

A sample platform descriptor file will look like this:

<platform xmlns="http://ns.adobe.com/air/extension/3.1">
 <sdkVersion>5.0</sdkVersion> 
 <linkerOptions> 
 <option>-w</option> 
 </linkerOptions> 
</platform>

Then, at the time of packaging the ANE, include the ADT switch –platformoptions, providing the path to the platform descriptor file. For example,

adt -package 
-target ane myextension.ane extension.xml 
-swc mySwc.swc 
-platform iPhone-ARM library.swf libmylib.a 
-platformoptions platform.xml

However, if you do not have the ANE source files, you can always package the IPA using the ADT command line. More help on using the ADT command line can be found here. For instance,

adt -package 
-target ipa-app-store 
-storetype pkcs12  
-keystore ../AppleDistribution.p12  
-provisioning-profile AppleDistribution.mobileprofile  
myApp.ipa myApp-app.xml myApp.swf icons Default.png

Installing/Uninstalling iOS AIR applications on iOS devices using ADT

$
0
0

With AIR 3.4, it would be possible to use ADT to install AIR applications on the iOS devices (i.e iPod, iPhone and iPad) from both desktop operating systems (i.e MAC and Windows). Prior to AIR3.4,  developers have to use iTunes, XCode etc to install the iOS AIR applications and that was a cumbersome process.

This new capability will make the install/uninstall process a lot more seamless. To install/uninstall an iOS AIR application on the device, simply follow the following instructions:

First of all, we need to know the number of devices, along with their device-id’s, which are attached to the machine. This can be done using the following ADT command.

adt -devices -platform ios
List of attached devices:
Handle	DeviceClass	DeviceUUID					DeviceName
   22	iPhone  	24d9b6fd...................a861117a7866510	myiPhone
   23	iPod    	24d9b6fd...................a861117a7866510	myIpod

The handle in the output of the above command is the device-id to be used to install/uninstall application in that particular device.

Once, we have the information about the devices attached to the machine we can use the following command to install the application on the device.

adt -installApp PLATFORM-OPTION PLATFORM-SDK-OPTION? DEVICE-OPTION? -package 
eg. adt -installApp -platform ios -device  <device-id>  -package /path/to/my.ipa

In case only one device is attached, there is no need to specify -device argument.

adt -installApp -platform ios -package /path/to/my.ipa

Similarly to uninstall the application from the ios device, use the following command line

adt -uninstallApp   PLATFORM-OPTION PLATFORM-SDK-OPTION? DEVICE-OPTION? -appid 
eg. adt -uninstallApp -platform ios -device <device-id>   -appid com.adobe.myapp

In case only one device is attached, there is no need to specify -device argument.

adt -uninstallApp -platform ios -appid com.adobe.myapp

NOTE:
<app-id> is specified in the application descriptor file (app.xml) within the <id> tag . If you create your project using Flash Builder, by default it would be the same as your app name.





Latest Images