Multi-resolution development - how to? - starling-framework

I am developing an iOS app in starling for all ios devices. I am having a hard time getting my head around how to use the AssetManager class and scalefactor setting to manage all the different resolutions.
I think the official article (http://wiki.starling-framework.org/manual/multi-resolution_development) from starling and the scaffold project leaves a lot to be desired - it does not even take into account the retina iPad.
I can easily set things up so i can distinguish between iPad and retina iPad or iPhone and retina iPhone, but how can i combine the two and still be able to setup the app in a way that is manageable?
Any links to tutorials or articles on this topic would be great.

here is the link for great tutorial series on developing multi resolution app.
http://my.safaribooksonline.com/9781449320904/ch01s25_html?readerfullscreen=&readerleftmenu=1&reader=

I ignore the starling scalefactor and AssetManager, and write my own Assets and Global class. At application startup I check the device resolution and set Global.scale to 2 - if iPad 3+, 1 if other, <1 - if something weird like iPhone 3. That way my Assets class knows which textures to load and with what scale to create textures out of images. I Also use Global.scale for any numbers like text size or padding by multiplying by scale. I had to write a bit of reused code by myself but it was worth in my opinion, because I can change anything I like to make it even better with every release of starling.

Related

How to make Adobe AIR application for iOS supporting both new and old screen size

I've been a Flash animator for a few years and recently tried my hand at developing a simple iOS application using Flash CS6 and AS3.
When I began development I was creating for the iPhone 4S' screen size, however now with the release of the iPhone 5 the new screen size obviously doesn't fill the screen, resulting in the black-bar letterboxing at the top and bottom of the screen.
I have three questions to ask:
Is it possible to release two different versions of the app onto the App Store for separate devices or does it have to be universal? (I believe the answer is the latter but I can't find a definitive answer)
Is it possible to have a stage size that matches the iPhone 5's larger display but cut off the bottom (for example) for the previous iPhone sizes, in effect just adding some information to the bottom of the screen exclusively for iPhone 5 users?
If (2) is not possible, is there coding examples available change positions of items on the screen? For example, I have a title and taskbar as well as a background, could I code it to stretch to the size of the device screen rather than the stage? And would I need to alter the stage size or is there code available to do that for me?
I'm quite new to the programming aspect of AS3 and I'm sorry if there are answers that you feel that I should know, but I'm really thankful for your time to read and answer and I thank you in advance for your replies!
Ben Kahan
While all of your options are possible, you'll want to make sure your program dynamically lays itself out and resizes visual assets depending on screen size, pixel density and orientation.
More here:
One Application, Five Screens (Including the iPad)
and
Writing Multiscreen AIR Apps
You should look into doing number 3! 1 will be a hell to maintain, 2 will piss off users with smaller screen. If you design your application a bit more flexible, that would also mean you have an app that works on android ;)
I don't have any particular code for handling different screen sizes, but I remember reading about it back when Adobe introduced FP for mobile. This article gives a lot of good advice for delveloping for mobile (even though it is a bit old) -- maybe you can find something that is more up to date though google :)

iPhone VS ipad development process (differences and similarities)

I am new to iOS development. I am trying to figure out these things.
A project both in iPhone and iPad. what things are same for both (coding, graphics or UI)?
Design Pattern of apps are same or different?
waiting for answer
Thanks :)
Personally, I find that the only real difference between the iPhone and the iPad is the UI and UX. Most of the code is the same for both applications. (In fact, you can even reuse a lot of code if you are doing a universal app!)
The main difference really is the screen size. The iPad is huge in comparison to the iPhone, and this difference gives you a lot more options to work with.
Another thing to note is that the iPad is usually done in landscape orientation, whereas the iPhone is done in portrait. This is not an absolute rule however, it's just the way I see it.
The graphics aren't too different between the devices, except that because of the large screen size, you can do a bit more detailed work with the iPad images then the iPhone images. (Even with the retina display, too fine detail on the iPhone is barely noticeable.)
The other thing I wanted to mention is the flow of the devices. Again, because of the screen size of the iPad, you can fit a lot more content on the screen, and therefore have to push to new views less frequently. I've worked on apps where we had 3 UIViewController's for the iPhone version, and only 1 for the iPad version.
In short, it depends really on your type of app. If you have a lot of content, and want to display it all at once, go for the iPad. If you want a streamlined, minimal approach to your app, go for the iPhone.
Again, this is all just my personal opinion. Hope that Helps!
You can use native controls without much theming and customization on the iPhone. But iPad is a bigger beast. Users use your iPad app for a longer time. iPhone apps are used for a short stint and then closed, used again for a short stint and so on.
Analytics published by Flurry showed that the average time an iPhone app is kept open is about 1.2 minutes. Design and develop it in a way that data is available as fast as you can.
iPad apps are used in a relaxed setting. While I don't have the numbers, it's probably used more often and for a longer time than an iPhone app. Themes and custom UI elements do matter a lot there
Second, iPad apps need to be supported on all orientation (or at least a minimum of two orientations)

iPad Content Scale Factor x2 for iPhone application

I'm hoping to recursively change every single View in my application to use the iPhone 4 graphics, and change the content scale factor to 2.0, such that it's the zoomed in version of my iPhone application on the iPad by default.
Currently, the iPad starts out in x1 Zoom, which is the 320x480 pixel version displayed on the 1024x768 real estate of the iPad, where the powers that be have declared that they're too cheap to actually invest in an iPad app, instead requesting that we have the application use iPhone retina graphics with a default content scale factor of 2.0
Upon googling and searching stackoverflow it seems my query is unique, though some questions are sort of similar such as -> Problem adapting scale factor for iPad x2 compatibility mode
And the best way to go about doing this remains undocumented, so I hope to implement this 'hack' so to speak in the best most succinct way possible.
If anyone has done this before, please share the code, otherwise I will update this with my own answer once I've figured it out.
The Answer: THIS CANNOT BE DONE.
The iPad will treat the screen as 480x320, even at 2x, so even if you change the contentScaleFactor appropriately and force it to use #2x.png images, you won't get any better resolution.
This is built into the iphone Operating system, only the Jailbroken iPads can get around this. Which isn't an option to consider.
It's easier to just duplicate the target for iPad, and realign the nib files appropriately, and make the app a Universal App.
It's a daft idea, and even if Apple change this in future SDK releases, it won't be backward compatible which again isn't an option, at least for our development team.
I think the best way to do it rules out using nib files.
If you create your views in code, you can easily use conditional code ([[UIDevice currentDevice] userInterfaceIdiom]) and based on that set the scale for the UIView elements.

How to make iPad use the #2x.png high res images in "2x" mode

I've read the documentation and googled until I couldn't google anymore, but still I cannot figure out how to make my iPhone app use the higher resolution images when displayed in "2x" mode on the iPad.
I have Icon.png Icon#2x.png and Icon-72.png and they work fine, but I don't want to have to rename all of my images. Also, the "2x" just seems to scale up pixels so text and IB objects look terrible. Is there a fix for this? Any suggestions would be greatly appreciated!
Note: This is not a universal app. I don't want to make it into a universal app. I just want it to scale up and look pretty on the ipad.
It is possible, at least in Cocos2D apps. Matt Rix does exactly this in his app Trainyard and it looks great on the iPad at 2x! He covers some of the details on his blog: Retinafy your Game.
Apple want you to write native iPad apps, so they deliberately don't support this, and there's no way to make it happen that I'm aware of.
You can register for the notification _UIClassicApplicationWillChangeZoomNotificationName and scale your graphics appropriately, i.e. by setting the rasterizationScale on the CALayer to the value returned by [[UIScreen mainScreen] scale].

How will I have to update how I program for iPhones now with iOS4?

For example, preparing a launch screen of 320 x 480 would have to be changed....
How is that going to work for us? Are programmers always going to have to be submitting a high-res that will be scaled down for old devices such as the iphone 3g?
The size of the screen is basically 4 times on a pixel by pixel basis. So each pixel of your image for example gets boosted to 4.
What this means for you? You don't have to change your App, your app will scale to the hi res screen for you, same with your UI and images within your UI. Of course if you want to take advantage of the better screen quality you will have to submit hi res images.
I haven't looked at going the other way but I believe it would be a similar case.
One exception to this is text. It automatically scales to the higher res for you for free. So text will look super sharp. One problem with this is if your loading image has text based on the original load screen that wouldn't look the same as when the high res text loads.
Strictly speaking, anyone who's seen the documentation on how they're handling this is still under non-disclosure until Monday, when the new iOS ships.
Suffice to say, it's clever. You'll be able to put both high and low-rez versions of ALL your images into your app, and then load them into your app in a way that's totally transparent from the code side. The device will make its own call about which version of the image is appropriate for the kind of screen it's got.
Now that the WWDC 2010 videos are available for free to any registered iPhone developer (or ADC member), I recommend watching Session 134: Optimize your iPhone App for the Retina Display for a full description of what you need to do to support the iPhone 4's new display.