Skip to main content
May 6, 2013
Answered

Building apps for iPhone and Android

  • May 6, 2013
  • 2 replies
  • 1108 views

Hi guys

I'm making my way through:

Professional Flash Mobile Development: Creating Android and iPhone Applications - by Richard Wagner

I'm planning on making a single app for both iPhone and Android in Flash Pro

I understand that there is a different set up for each platform, but I was wondering if anyone here experienced in app making using Flash has any tips for developing for both platforms with minimal change to code - ie not having to change your main base code too much, and also, what you found you did need to change between platforms?

I'm especially interested in catering for different size screens. Ideally I'd like the app to stretch to fit whatever screen eg iPhone/iPad/large Android etc, but maintain it's aspect ratio. But I noticed in the demo apps in the book, you stipulate the viewport eg;

private const VIEWPORT_WIDTH:int = 320;

private const VIEWPORT_HEIGHT:int = 480;

So if you're stipulating the viewport size, how do you release one app to the apple marketplace that will suit both iPhones and iPads?

Thanks for your time and sharing your experience.

This topic has been closed for replies.
Correct answer vamsibalu

I have experianced the situation, I have searched a lot to find the solution.

just use stage.scaleMode = StageScaleMode.ShowAll.

so swf stage will be in center and scaled proportionally whatever the screen size, and use extra area beyond your swf width  and only for width this is called safe area that will be used in bigger screens.

we have been doing it and no issues at all for any kind of device both Iphone and Android.

2 replies

vamsibaluCorrect answer
Participating Frequently
May 6, 2013

I have experianced the situation, I have searched a lot to find the solution.

just use stage.scaleMode = StageScaleMode.ShowAll.

so swf stage will be in center and scaled proportionally whatever the screen size, and use extra area beyond your swf width  and only for width this is called safe area that will be used in bigger screens.

we have been doing it and no issues at all for any kind of device both Iphone and Android.

May 7, 2013

Thank you both.

stage.scaleMode = StageScaleMode.ShowAll sounds like what I am after - I will have a play with it.

kglad
Community Expert
Community Expert
May 7, 2013

if you use showall, you will have borders displayed on two sides of the screen in, at least, one of your apps.

kglad
Community Expert
Community Expert
May 6, 2013

you should use actionscript to detect the screen size or you'll need to create two different apps.