Adobe et al,
With the new iPad 3 we now have a ton more pixels to utilize. I'm familiar with and have already successfully tested the AIR 3.1+ commandline compiler option (-platformsdk) to get Retina display on the new iPad. In ActionScript mobile projects the content is rendered beautifully on the new iPad. But with Flex Mobile projects, something is happening that causes it to render incorrectly. It's retina display alright, but the size is way too small.
Below is an image WITHOUT the -platformsdk build tag, that causes the app to be pixel doubled to fit on the new iPad:
Notice that it's scaled proportionally, even though the text and components are slightly pixelated. Not a big deal, but noticeable on the device.
This image is taken with the app rendering in Retina display (setting the -platformsdk pointing to iOS 5.1 SDK):
As you can see, the text/components are rendered really clear, but the scale is way off. Obviously it's getting the width of 2048x1536 from the device, but it's way too small.
How do I fix this? I've tried changing the applicationDPI, but it doesn't fix it. Setting a width/height of 1024x768 does nothing either. It seems we need to overrride a behavior that causes it to fit everything in so small.
A little help?
Thanks,
iBrent
Can anyone tell me if they're looking into this? The biggest problem is that it essentially renders Flex USELESS for iPad apps. I realize Adobe has dropped Flex, but this is a concern with the existing 4.6 SDK, and it would great to get a resolution to this problem before jumping to Apache Flex to find a solution. (Did you see what I said there, "resolution" to the problem) ;-)
iBrent
Richard Lord posted a blog yesterday Using the iPad retina display with Adobe Air and one of the things I noticed is that the new iPad returns a DPI of 132, the specs say the device is 264 ppi. I don't have one of the new iPads, so I can't test this, but it sounds as though this is just a case of the device returning the wrong DPI which is something that has happened before. I'd check the section on this page entitled "Override the default DPI" and see what happens if the device were to return 240 when running on the new iPad.
Alright, kevinkorngut's answer was the right one. It appears that even though AIR 3.x can render high resolution apps, it still returns the incorrect DPI for the new iPad. In a Flex Mobile project you have to override the DPI using the method mentioned above.
Here are the results I got:
Using the runtimeDPIProvider property on the TabViewApplication tag (works for any of the three project types) I created a class that extends RuntimeDPIProvider. To detect which iPad I was on, I used the following code:
override public function get runtimeDPI():Number
{
var os:String = Capabilities.os;
if(os.indexOf("iPad") != -1)
{
if(Capabilities.screenResolutionX > 2000 || Capabilities.screenResolutionY > 2000)
{
return DPIClassification.DPI_320;
} else {
return DPIClassification.DPI_160;
}
} else {
return Capabilities.screenDPI;
}
}
I'm returning a DPI of 320 as this gives the best result that matches the proportions of the device. In other words, even though the iPad DPI is 264, setting the app to 320 gives the correct size at the new Retina display.
In order for this to work, you must compile the app with the -platformsdk flag pointing to iOS 5.1 SDK, and currently that means you need a Mac running Lion with Xcode 4.3.1. Here's the adt command I used:
adt -package -target ipa-test -storetype pkcs12 -keystore ~/Desktop/iOS_DevCert.p12 -provisioning-profile ~/Desktop/iOS_DevProfile.mobileprovision newiPadTest.ipa newiPadTest-app.xml newiPadTest.swf -platformsdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platfor m/Developer/SDKs/iPhoneOS5.1.sdk
Also, the -app.xml descriptor file must have the <requestedDisplayResolution>high</requestedDisplayResolution> within the <iPhone> tags.
Thanks everyone for their replies!
iBrent
Hi,
I just followed the procedure .I set the applicationDPI as 160 and it shows all the UI elements perfectly in both ipad2 and 3.
But there is an issue in localToGlobal() . This method returns different values for ipad 2 and 3 and makes so many issues on screen.
Did any one else experienced the same behavior..?Please can some one verify it..
Any implementation of localToGlobal or globalToLocal will replicate the issue.(tried localToGlobalContent as well with the same result)
Thanks
Not sure whether globalToLocal / localToGlobal bug could be anything to do with this?
https://bugs.adobe.com/jira/browse/FB-35856
G
North America
Europe, Middle East and Africa
Asia Pacific