Skip to main content
Inspiring
September 16, 2013
Question

Android display resolution

  • September 16, 2013
  • 2 replies
  • 4606 views

When building an AIR app for iOS, inside of the (app.xml) file there is a section for <iPhone>

Inside the iPhone section is a <requestedDisplayResolution>

I understand what this feature does and I am able to use it correctly... but my question is... Is there anything like this for Android?

This topic has been closed for replies.

2 replies

zeh
Inspiring
September 20, 2013

I don't see a need for this on Android. The high/normal moniker is a poor way to denote density, and the parameter is there just as a quick way to support old apps on the high density displays. Adding this would only cause confusion and a doubtful improvement. This is gonna bite Apple's in the ass in the future if they ever want to add a different pixel density since they'll just keep on adding magical keywords.

On Android you read the display pixel density by reading Capabilities.screenDPI (since displays can have any number of different pixel densities). Then based on this you can decide what to do (load higher res image, whatever).

If you want to have the same behavior on Android as the "high" parameter on iOS, you can just read the pixel density on your app's startup and resize your main app container Sprite scaleX and scaleY as desired. That way you won't have to take the current size into consideration anywhere else.

Inspiring
September 23, 2013

Thanks for your comments

Sadly I am porting a very large previously existing  Desktop AIR application that uses many bitmaps instead of vector.

The reason I was hoping for a simple Android solution similar to the iOS one, is that my client simply does not have the budget for the time it would require me to go

redo all every section/feature to scale up, simply because this was pitched as "Now AIR can be compiled iOS and Android!"... and it does... just I didnt know it requires redoing stuff for Android only.

zeh
Inspiring
September 23, 2013

But it doesn't require you redoing anything. The same issues you'd having porting a "normal" iOS app to a "high resolution" iOS app are the issues you'd have with supporting other Android pixel densities. You'll scale the Bitmaps up.

If you want to solve this quickly, just resize your main container, or use stage scale modes like Colin suggested. This will have the same effect as running an old iOS app on a new iOS device. You may need to search for references to stageWidth or stageHeight on the app to make sure it's not trying to be clever, but you won't have to touch the content or recreate bitmaps or whatever.

That tag is not magic. It's there to make scaling the content faster. But the same can be accomplished by a couple of lines on Android or other platforms.

Inspiring
September 19, 2013

Basically for an iPad3, it's retina display is 1,536 x 2,048.. but if you include something like this line:

<requestedDisplayResolution excludeDevices="iPad">high</requestedDisplayResolution>

it forces the iPad3 to be 768x1024, just the same as the iPad2....

So again my question is.... anything like this for android?

Adobe Employee
September 20, 2013

No, as of now, this is only for iOS.

Regards,

Nimit

Inspiring
September 20, 2013

are there any plans of doing anything like this? I recently upgraded to a Galaxy S4 with 1920 x1080 & 441 ppi and all my apps are ridiculously tiny.