Posts tagged "iOS"

Launch Images on iOS with Adobe AIR

Introduction:

To make an impression of a super-quick response and to give the application suitable time to load completely, iOS introduced the concept of a launch image. A launch image is the first interaction of an application with the user; so it becomes vital to have a properly displayed image at start up. The launch image is displayed while the application is loading, and as per iOS human interface guidelines, it’s one of the must-have requirements for an application.

For Adobe AIR applications, a launch image must remain visible until the AIR runtime is completely initialized. To accomplish this, AIR runtime displays the same launch image as displayed by iOS until the application is ready for use.

To support an application on all iOS devices, one should include launch images of various sizes and resolutions as per the following naming scheme.

Naming scheme

Basename + screen size modifier + orientation + scale + device + .png

Basename is the name specified in UILaunchImageFile key in the InfoAdditions element in the application descriptor. Usually it is given as the value, Default.

Screen size modifier when multiplied by the scale factor of the device, gives the actual dimensions of the device.  For example, screen modifier for iPhone 5s is 568h, which, when multiplied by scale factor of 2 gives 1136h – the actual height of iPhone 5s in pixels.

Orientation- different launch images can be displayed on an iPad and iPhone 6 plus, based on their orientation, at the time of application launch.

Scale factor for non-retina display devices is 1x and for retina devices it is 2x. The recently launched iPhone 6 plus has a scale factor of 3x.

Device portion is provided in applications that can run on both iPhone and iPad. Its value can either be ~iphone or ~ipad.

With the introduction of the new iPhone 6 and iPhone 6 plus in the market, there has not been enough clarity about all the images that need to be included while packaging applications for iPhone 6 and iPhone 6 plus. The following table lists combination of launch images that can be provided to have a properly working application.

 

Devices Resolution  (pixels) Launch image name Orientation

iPhone

iPhone4
(non-retina)
640×960 Default~iphone.png Portrait
iPhone 4,4s 640×960 Default@2x~iphone.png Portrait
iPhone 5,5c,5s 640×1136 Default-568h@2x~iphone.png Portrait
iPhone 6 750×1334 Default-375w-667h@2x~iphone.png Portrait
iPhone 6+ 1242×2208 Default-414w-736h@3x~iphone.png Portrait
iPhone 6+ 2208×1242 Default-Landscape-414w-736h@3x~iphone.png Landscape

iPad

iPad 1,2 768×1024 Default-Portrait~ipad.png Portrait
iPad 1,2 768×1024 Default-PortraitUpsideDown~ipad.png Upside down portrait
iPad 1,2 1024×768 Default-Landscape~ipad.png Left landscape
iPad 1,2 1024×768 Default-LandscapeRight~ipad.png Right landscape
iPad 3,Air 1536×2048 Default-Portrait@2x~ipad.png Portrait
iPad 3,Air 1536×2048 Default-PortraitUpsideDown@2x~ipad.png Upside down portrait
iPad 3,Air 2048×1536 Default-LandscapeLeft@2x~ipad.png Left landscape
iPad 3,Air 2048×1536 Default-LandscapeRight@2x~ipad.png Right landscape

Number of images to include may vary according to the application requirement. If an application is built only for an iPhone, then iPad images can be skipped and vice versa.

On iPhone 6 and iPhone 6 plus, newly introduced display modes (Standard and Zoomed) makes the situation a bit tricky. In Standard mode, both devices display launch image as per the table shown above. In zoomed mode, however, the launch image of its predecessor device is displayed, which means on iPhone 6 plus, image meant for iPhone 6 i.e. Default-375w-667h@2x~iphone.png is displayed, likewise  on iPhone 6 launch image of iPhone 5 is displayed.

Launch Images

 


How to package launch images:

To include launch images in your application, all launch images are required to be placed at the top-most level or base location of your project hierarchy. For example if the base location is the src folder, then all launch images should be placed as shown in the following screenshot.

Demo Project

Project hierarchy

 

However, if you wish to package your iOS application using the command line then launch images can be added as assets in packaging command. For example, to package a Demo app with all iPhone launch images then the same can be done using the following command.

adt -package -target <target> -provisioning-profile <Profile> -storetype pkcs12 -keystore <Certificates.p12> -storepass <password> Demo.ipa Demo-app.xml Demo.swf  Default~iphone.png Default@2x~iphone.png Default-568h@2x~iphone.png Default-375w-667h@2x~iphone.png Default-414w-736h@3x~iphone.png Default-Landscape-414w-736h@3x~iphone.png


Known Issues:

Currently the following known issues exist with launch images in Adobe AIR SDK version 17.0.0.123.

  1. 3945071 : [iPhone 6 +] An inverted launch image is displayed for a split second when the device is kept at rotated right Landscape orientation (Aspect Ratio is landscape and Auto Orients is false).
  2. 3945046 : [iPhone 6 +] An inverted launch image is displayed, if the device is kept in upside-down position and (Auto orient is true and Aspect ratio landscape).
  3. 3945056 : [iPhone 6 +] If a landscape image is not provided for iPhone 6 +, Stretched Portrait launch image is displayed when application is launched in landscape mode.

For more information on iOS Launch image you can refer to Apple’s iOS Human Interface Guidelines.

External hosting of secondary SWFs for AIR apps on iOS

Starting with AIR 3.7, application developers will be able to host their secondary SWFs on an external server and load them on demand as per their application logic.

Till AIR 3.5, loading of only assets such as images, videos and SWFs without actionscript code, commonly referred as Actionscript Byte Code(ABC Code), from external server was supported. The workflow for the application developer for loading such assets from server resembles the diagram below :

 AIR 3.5 Workflow

With AIR 3.6, the feature for loading of locally packaged secondary SWFs containing ABC code was introduced. The detailed description about this feature and its usage can be found at this blog – “Packaging and loading of multiple SWFs for AIR apps on iOS“. The workflow for the application developer using this feature is described in the diagram below:

Continue reading…

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…

Launch Images for AIR Applications on iOS

Apple expects all its iOS applications to have launch images for all supported devices and resolutions to enhance the user experience at application launch.  In general, an iPhone application should have a Portrait launch image and an iPad application should have a launch image as per the launch orientation of the application. As mentioned here, every application must include launch image for different sizes and resolution. Looking at the sizes closely, we notice that Apple expects fullscreen launch images for iPhone whereas it expects non fullscreen launch images for iPad. This size recommendation by Apple is irrespective of the fact whether the application is meant to be fullscreen or not. Continue reading…

Orientation Changes in AIR 3.5

Apple has made a significant change in the application orientation APIs in the newly released iOS 6 SDK. Some of the auto-orientation callbacks have been completely deprecated in iOS 6 SDK. This means apps packaged with iOS 6 SDK and running on iOS 6 devices will not receive the deprecated callbacks. However the same apps running on iOS 5.1 or earlier will continue to receive the deprecated native callbacks. This change affects the screen orientation API’s in AIR too and support for the new callbacks have been added in AIR 3.5 beta release available here.

Prior to iOS 6 SDK, native orientation callbacks informed the application about the new orientation it was being rotated to. Hence, an application could decide whether it wanted to rotate to the new orientation or not at runtime. However, the new callbacks do not give us such information.The OS only queries the application about the set of orientations it currently supports. If the new orientation that the application is being rotated to is one of these values, the application rotates automatically. Otherwise it does not. Continue reading…