Building an iOS app with Adobe Flex Builder - Performance Issues - iphone

I'm building an app for iOS with Adobe Flex builder and compiling it into an .ipa using Adobe's tools.
Through initial testing, I see that the end result isn't as rich as native code, nor is it as fast or smooth.
Without simply saying 'why dont you just use objective-c', are there any documentation as to the overhead to building an app this way?
Specifically, what kind of performance hit can you expect when using Adobe's platform instead?

Make sure you are using the latest AIR 3.0 SDK for iOS packaging. It is notably higher performance.
Consider best practices when developing your app:
http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf
http://www.mikechambers.com/blog/files/presentations/fitc_amsterdam_2010/flash_iphone_fitc_2010.pdf
Blanket comparisons to native Objective-C is a wide topic, to which capability of Flash ubiquitous deployment to multiple platforms should also be considered if you're targeting Android and BlackBerry.
Perhaps citing specific issues of your implementation would help yield insight.

I too have been developing a Flash-based iOS app. My initial prototype was useless in an iPad 1. I had to look for ways to optimize. My second prototype is performing quite well. So here are some pointers.
1) Don't use timers. I had to write my own utility "FrameWorker" Singleton class to manage and delegate all my animations, or even delayed actions to a single enterFrame event. This alone will give you a huge speed boost.
2) Don't use many enterFrame events on different objects. As I said on point one, find a way to use a single enterFrame that you can add and remove processes to.
3) Avoid vectors as much as possible-use images. If you need to draw objects in the Flash IDE or via action script, use cacheAsBitmap = true.
4) Don't use visual objects that are much larger than the screen area. If you need to use large objects across the screen, then manage them off the display list and learn blitting techniques to draw to the screen ONLY the rect that will be display at that time. Lee Brimlow has a couple of good starter tutorials.
5) Be very disciplined about managing events. Make sure you always remove listeners that are not necessary anymore for instance.
6) Distribute your app's load to different frames. Don't do too many intensive things on a single frame.
If you follow these pointers your app will be as fast as any out there.

Related

Crossplatform framework is suitable to do all things in Mobile Application as Native?

I am working in iPhone SDK.I have to convert from it to Crossplatform which may be either phonegap or titanium.As a iPhone Native application developer, I have some questions based on cross paltform.please consider the questions for other platforms android,etc also.I have already seen the stackoverflow Link.
1)Is it possible to get equal functionalities of all APIs which are in iPhone SDK through HTML5 and javascript?
2)If Apple releases New Version of iPhone SDK,will New APIs be included ASAP in Crossplatform?
3)If The App crashes in some situation, can I fix immediately through Device Debugging as we do in native Language?
4)The applications developed by Cross platform will be approved by Apple legaly?For example If i want to do live streaming in iphone , The restrictions have mentioned in Apple website.has it been followed by crossplatform?
5)will Application developed by cross platform take more memory?I mention the size of device build for appstore?If we develop the same through objective C,will size be reduced?
***My Conclusion is When we want to develop simple Applications for Multiple devices,crossplatform is suitable.Am I right?***I hope doing through native language(iphonensdk, Android) will avoid lot of Unnecessary things.
No.
If the API can be made available, it depends on how fast the creators of the framework implement it.
In principle, yes, as those frameworks employ a limited amount of OS capabilities to run web-technology (in most cases). This "wrapper" behaves as any native app does. For the content however the rules of the frameworks development language apply. It may be harder compared to native development to track down errors, since they must "pass the shell". Html errors for example may produce the same error for their enclosing webview again and again, despite being different in origin.
Propably.
That's hard to tell. It may depend on the framework. I wouldn't worry about the code as other ressources like imagery are usually the heavier load. But it may be very well the case that those frameworks bring along imagery necessary for their UI elements, since they do not rely on OS elements entirely. Compared to a native app which comes with no extra ressources at all, a crossplatform app with the same functionality might take more memory.
As to your conclusion: You're right. However I'd still encourage anyone to develop native applications whenever possible. Crossplatform frameworks tend to be slower at runtime and, in some cases, produce very ugly apps. I know several examples of apps which have been created with a variety of crossplatforms and I don't like any of them. They just don't feel right. Partly that's due to their UI elements which don't look and feel as you'd expect it on the platform you're on.
The principle behind crossplatform frameworks may appear to be logical, tempting and in some cases, straight economics mandate their use. But, for the time being, I find the results far from being satisfactory and for that reason would never touch a crossplatform framework.
In my experience (with a closed, private, expensive x-platform thing purchased by the employer), it was utterly frustrating, and incredibly difficult. Therefore, it is my preference to maintain multiple native apps.
The UI considerations that can be made/handled by the native app, as well as the functionality and speed gained by doing it natively, IMHO, far outweigh the benefit of having to write it 2 or 3 times.
In an ideal world, you would have a specialist for each platform that can lead the team on the "deep" things, and then everyone can generalize for all of the platforms, increasing their depth through the course of the project.

Multi-Mobile Device Application Architecture

I'm considering building an application for Windows Phone 7, Android, iphone, ipad, and potentially more. Since i'm going to be leveraging a similar look and feel and content, it seems to me like it might be worthwhile to try to create a common base structure that I could reuse across environments.
For instance, i could define the structure of the UI using XML or something, or utilize some common construction of the application which I could build a translator to gen the code in other environments, or even something else. I'm in the very, very beginning stages of thought, and was wondering if anyone has tried this and come up with a good approach? Any ideas?
Thanks.
Beyond simple applications, it not going to happen.
The are a number of problems you will face like:
Different native programming languages on different mobile platforms.
Different UI paradigms on the different mobile platforms.
Very different screen sizes even on the same mobile platform (e.g. iphone vs ipad).
UI Localisation
To really take advantage of each mobile platform, you need to build the UI for that platform to maximise it's UI paradigm. It also matters what screen sizes you want to support, catering for small screen sizes can hamstring you in what you can display in the UI unless you build different screen layout for different screen sizes to give a better UI experience (a lot of work). This can be a big problem on one platform let alone expanding it to other platforms.
For the platforms listed, you can try using mono, but that will only help in the following ways:
One programming language (C#) instead of a different language per platform.
Application engine logic can be shared between platforms.
Native UI per application.
The cons of using mono would be:
You still need to write the UI layer per platform as mono binds to the underlying UI api.
Mono runtime overhead in size and sometimes speed.
Mono on the mobile platforms are still new, I have developed one iphone application in monotouch and I found lots of first-release type problems with it.
If you don't mind some of the con's then mono can be a great platform for developing certain levels of applications.
I have found that trying to define a master UI layout just doesn't work in all situations in any application that gets to complex in the information it needs to display to the user. No matter how "complex" you can define the layout, something will break it. You either have to live with a "bad" UI in some cases or have a maintenance overhead.
I like to develop an application for the mobile platform to try can get the most out of that platform and it's features. This may mean that other platform versions of the app may work differently but at least it will feel correct on that platform.
There are some x-platform kits: appcelerator, phonegap, etc. Or you could go the hybrid route and use something like mono as a half measure, then there is the possibility of building a web app with html5.
I wouldn't try to roll my own, that's for sure
Be careful when translating iPad to Android designs. Hopefully this article can help you out:
http://morriscodes.blogspot.com/2012/09/designing-for-android-tablets-vs-ipad.html

What should I consider to ensure seamless port of my iPhone apps to iPad?

Following iPad's announcement and its SDK (iPhone SDK 3.2), porting apps to iPad becomes an important issue. What guidelines I should follow in my iPhone apps to ensure I can port it to iPad as seamlessly as possible?
The different resolution is particularly an important issue. While the iPad runs iPhone apps unmodified, it's not really the desirable behavior for a native app. How can we make our iPhone apps resolution-independent so that they can run gracefully on all resolutions like most desktop apps?
If you've been using IB and setting the resize behaviors of elements properly, and also coding frame coordinates all relative to each other you are half-way to having a UI that can potentially scale to a larger screen.
From the screen shots there are new kinds of action-sheets as well, potentially attached to UI elements instead of floating - if you use overlays today they will probably work about the same but you may want to consider changing placement from the center on larger display.
UPDATE:
Now the event is over, and registered developers can download the SDK - although we cannot talk about specific features here just yet, read through ALL of the documents related to the new OS version as there are a number of things aimed at helping you transition to supporting both platforms. Also before you start using custom libraries for things take a look through the API changes to see what new abilities might be supported that are not today.
Generally speaking, what I said above about IB holds true, and also you should start thinking about how your apps today could use more space to present more information at once instead of being split out over multiple screens. Also if you are doing any projects right now that use images, make sure to initially design the images large enough that you can also use them for higher resolution tablet applications.
It is far more reasonable to expect users to input text (and larger amounts of it) than with a non-iPad device.
Nothing, it appears. Although we don't have the SDK quite yet. It will all existing run iPhone app without an issue, albeit at reduced resolution.
It remains to be seen how much of the existing iPhone SDK is shared with the iPad SDK UI wise.
Judging by what has been said, absolutely nothing. You will have to adapt to the new screen size and better hardware all together, if you want to take advantage of the features that the improved device offers. The lack of a 3g module is also something to consider if your app(s) rely on that functionality.

Software development methodology when doing Iphone development

What kind of practices do you do when developing iPhone apps? For instance, do you write up a technical design document of any sort. Do you write down the design of your app at all? Do you implement a certain methodology agile/scrum/waterfall etc...? I'm just curious when working on projects like an iPhone app, what kind of best practices do people use or do people just go at it?
I've worked on a few iPhone apps, and I've found this workflow works pretty well:
Figure out what the app is going to do. Create a one sentence description of the app that embodies what you're trying to do. If you can't explain the core functionality in one sentence, people won't get it!
Create interface mockups for each screen of the app on paper, and then in Adobe Fireworks. Fireworks' native file format is PNG, so it's easy to create images for use in the actual app later.
Figure out how you're going to architect your app using Model-View-Controller and the other iPhone app design patterns (delegates, dataSources, etc...). Don't try to do something other than MVC. The whole SDK is built around MVC!
Start coding! I usually start with the bare functionality first. For a drawing app, I implement the drawing controller and the important drawing views (color picker, etc..) first. I back things up to an offsite SVN repository as I go using Versions (I haven't had much luck with the repository support in Xcode)
Distribute a beta version of the app to a group of AdHoc testers. This helps a lot. Getting the app in the hands of a few extra people really helps isolate usability issues and bugs that are hard for a single developer to find.
Repeat until satisfied and Apple approves :-)
I haven't done much with iPhone development, but its irrelevant. I wouldn't consider it any different from any other developmental process.
The process is different for each case, some have at it and others follow their development methodologies.
As one who is about to dabble in his first iPhone app, I don't think there is any one methodology that rules over any other. You can apply any of the techniques you mention to an iPhone app, just like any other development effort.
A key thing about iPhone apps, or any Apple related development effort, is that Apple sort of forces you to follow certain design guidelines. That is good in some ways (less to concern yourself with) and bad in others (restrictive).
Also, Objective-C and Cocoa Touch can also lend itself to certain ways of programming.
Now, specifically for me, as a sole developer, I will probably:
Jot down high level features of what I want to be included in the first version
Do an interface mockup (either on paper or with a software tool)
Jot down some key objects and functions (psuedo-code)
Set up a source control mechanism (I think this is key)
Start going at it
Possible repeat of any or all of 1-3 :-)
I prefer to start with small proof-of-principle projects to test out different capabilities of the device that I need for my final product. This is especially important on a mobile device like the iPhone, because hardware limits on memory, processing power, graphics, or display size can render some ideas impractical. It's best to know that your application won't work as you imagined after only a couple of days of playing around, rather than after a month of development.
John Geleynse and others at Apple advocate starting your design with a single sentence that describes your product and its intended audience, and building everything around that mission statement. I've found that this works extremely well for determining what features to incorporate or leave out of a product, particularly on the iPhone. Having a simple core product description at the center of your design is also extremely helpful when you need to explain this product to others in your later marketing efforts.
Aside from that, I've found that iterative development incorporating lots of testing and user feedback has worked for me on every platform I've developed for.

Is it feasible to make iPhone apps using just OpenGL and not Cocoa Touch?

I'd much rather code an app using pure C api such as OpenGL, rather that Cocoa Touch. So I'm wondering: is it feasible? Will I be able to maintain the same user experience that you get with Interface Builder?
None of the UI components have OpenGL equivalents. Is it possible? Yes. Is it sensible? No - you would be much better off learning how to use IB and the UIView classes. Coding the UI in OpenGL would be like painting your house with an artist's brush, using hand-made paint instead of Dulux.
Unless you are working on a game, users will expect your user interface widgets to work the same way they do in other applications. You can never emulate that properly, especially if apple decides to fix certain issues in future firmware upgrades, etc...
You will also need Cocoa for integrating with the system in general to store data, prefs and so forth. Is there any specific reason for your reluctance to use Cocoa? If it's because you feel an aversion to learning objective-c, then you really ought to give it a proper chance. It's a great language for building ui apps. If you are trying to port an existing app, then I would suggest building a wrapper that will interact properly with the iphone and call your c code from there.
This is not a fruitful answer (for that, see AirSource's) and rather a comment on your answer about not using Objective-C, but I learned Objective-C a few months after C# and I find I work well in both. Give it a chance and it will surprise you. There's a learning curve and they are different, but the interface tools in particular are so far ahead that you'll probably find it worth your while. It will definitely be better for you and for your app's users than hand-rolling it in OpenGL.
Depends on your app. Mine's an "immersive" game, so I'm using openGL
instead of CocoaTouch,
with a sprinkling of Core Graphics/UIKit calls to generate nice textures.
If I had to display any kind of standard, non-trivial widget, I'd use CocoaTouch.