Preventing Automatic Cloud Backup on iOS devices

According to the Apple guidelines, data that can be downloaded again or regenerated shall be stored in the <APPLICATION_HOME>/Library/Caches directory. So, with AIR 3.6, a new static property, File.cacheDirectory has been introduced, which points to this directory. Files stored in this directory are not backed up on the iCloud. Examples of files you should put in the Caches directory include database cache files and downloadable content, such as that used by magazine, newspaper, and map applications. On Mac OSX and Android, File.cacheDirectory points to the Caches directory ( <APPLICATION_HOME>/Library/Caches on Mac and <APPLICATION_HOME>/caches directory on Android). While on Windows, it points to the parent directory being used by File.createTempDirectory.

var myCacheFile: File = File.cacheDirectory.resolvePath("cacheFile.txt");

Continue reading…

Changed behavior of Shared Object on iOS in AIR 3.5

With AIR 3.5 the path of shared objects changed than it used to be in AIR 3.4, following illustrates the difference between paths:
In AIR 3.4:
AppName/Library/Application Support/com.namecompany.name/Local Store/ #SharedObjects/Filename.swf
where Filename.swf comes from the <Filename> tag of app-xml.

In AIR 3.5:
AppName/Library/Application Support/com.namecompany.name/Local Store/ #SharedObjects/Content.swf
where Content.swf comes from the <Content> tag of app-xml which contains
the name of root SWF of app.

This issue is fixed in 3.6(labs), so when user will update his/her app from AIR 3.4 to 3.6, then application will not lose any data which is stored with shared object. While any new App which will be published with next release of AIR will have shared object path:
AppName/Library/Application Support/com.namecompany.name/Local Store/ #SharedObjects/Content.swf

Workaround for AIR 3.5:

For those app-developers who are going to publish their app with AIR 3.5 there is a workaround for them.Since now shared object path is taken from tag <Content> rather than tag <Filename> so you can rename your root SWF to Filename.swf and also provide the same to tag. For example:
In AIR 3.4 :
<Filename>MysharedObject</Filename>
<Content>Root.swf</Content>

Now in AIR 3.5, rename it like following:
<Filename>MysharedObject</Filename>
<Content>MysharedObject.swf</Content>

and also rename Root.swf to MysharedObject.swf.
By this way the data of the app will be saved when it will be updated from AIR 3.4 to AIR 3.5.

We would like to hear your feedback, please let us know if you face any issues.

Excluding Devices From Requested Display Resolution Mode

RequestedDisplayResolution tag in application descriptor allows the developer to choose between standard or high resolution on iOS devices with high resolution screen. High resolution screens were earlier only available in iPhone and iPod 4th Generation and above. Recently released models on iPad namely iPad 3rd & 4th Generation also boast of a high resolution screen with 2048×1536 resolution. Specifying a ‘high’ value in requestedDisplayResolution tag enables the retina mode in the all iOS devices having the high resolution screen. Prior to AIR 3.6, there was no way to enable or disable retina mode on some specific devices. There existed some workarounds but they came with some trade offs of not able to use the iOS 6 specific features.

A new attribute ‘excludeDevices’ has been added in AIR 3.6  in the requestedDisplayResolution tag in the application descriptor. Developers will now be able to explicitly disable the specified display resolution on one or more iOS devices using this attribute.

<requestedDisplayResolution excludeDevices="iPhone4,1">high</requestedDisplayResolution>

Continue reading…

Packaging and loading multiple SWFs in AIR apps on iOS

In AIR SDK 3.6 for iOS, there is a new feature that allows application developers to be able to package and load secondary SWFs that contain ActionScript byte code (or ABC) in their apps. Presently, due to certain restrictions on iOS, AIR on iOS requires that all the ActionScript code of an application be present in the main SWF or the root SWF. With this feature, an application developer can have ActionScript code in local secondary SWFs and package them along with the main SWF.

Continue reading…

Deploying AIR Apps on iPhone 5

Apple recently released 5th generation of iPhone and iPod Touch. The 5th generation of iPhone and iPod Touch boasts of a 4 inch(diagonal) retina display screen with a resolution of 1136×960 pixels. The 4th generation of iPhone and iPod Touch  sported a 3.5 inch (diagonal) retina screen  with a resolution of 960×640 pixels, in comparison. The table below compares the screen size and resolution of 5th generation devices with the 4th generation devices.

Device Name

Screen Size

Resolution

iPhone and iPod Touch    ( 4th Generation)

3.5 inch (diagonal)

960*640

iPhone and iPod Touch    ( 5th Generation)

4 inch (diagonal)

1136*640

Continue reading…