It's a great thing that it's possible to compile an SWF into iOS native app. I think AIR is now the best option to write e.g. small games or interactive books. Of cause AIR app will be slowler than the same app written on e.g. objective C. The question is how slower AIR app will be. Can simple AIR apps be launched e.g. on iPhone 3G or iPAd 1?
And another question is, can arbitrary flash app be compiled into iOS native app?
Will be grateful for any thoughts!!!!!
Performance of AIR vs. Objective C:
For pure script execution, AIR apps perform rather slower than native, including on iOS. However, in virtually all cases the limiting factor of your app's performance will be rendering, not script, so it depends entirely on what you do visually in your content. This is why Crooksy suggested you look at Starling. Without Starling (or similar libraries that make use of the GPU), it's pretty challenging to get decent performance out of an iPad1. It can be done, but it takes expertise and incurs extra work. It will be much better to start with the huge performance boost of using Starling or similar.
Can arbitrary flash app be compiled into iOS native app?
As long as it's made with AS3, then it should compile. For whether it works, two main caveats come to mind: First, a handful of APIs don't work on mobile devices. (I think printing is one example.) Second, if you read in any SWFs at runtime, all actionscript inside them will be ignored. (Not for technical reasons, it's an Apple requirement.) So if your content is split into a bunch of SWFs you'll need to bundle them together at packaging time, and if you absolutely depend on reading in SWFs with script from the network at runtime, you're going to hit a wall.
Hope that helps!
Check out the new Starling frame work.
http://gamua.com/
Here's the start of a nice tutorial series (episodes 1 and 2)
http://www.hsharma.com/tutorials/
Lee Brimelow also has a few tutorials
http://www.gotoandlearn.com/
Regarding converting Flash apps into iOS compatible apps, yes that is possible but it depends on what the app actually does as to whether any modifications will be needed before it will perform correctly on a device.
Related
Hi i am developing an application using adobe air for iOS using flex.
i have the user take a snapshot and my intention is to upload the photo to my api.
the problem is when compressing the byteArray and then encoding it to a base64 String to send it up the apps freezes for 1-2 minutes.
My question is: is there a way to multithread this process in adove air, so i have it going in the background ?
and from your experience does an adobe native extension use another thread on the device for itself or no, maybe i can handle the background encoding and upload in a native extension.
Thank you all.
AS3, up until recently, was entirely single threaded. As of FP11.4 and AIR 3.4, you have access to Workers, which is essentially offloading tasks to a second thread. Beta support was added to Android in 3.8 or 3.9 and I believe it is out of beta now in 13.0. Workers are not supported by iOS, though. This is, I believe, because they have to cross compile to Objective-C to support iOS at all, so their methods won't work.
You're only option is to load the processing onto an ANE, which may or may not be a good idea. ANEs are meant to behave as a bridge between AIR and native OS APIs. While this would work, I think it goes beyond the scope of what an ANE is intended for.
Unless your photos are insanely large, I would suggest just not doing compression. Resizing photos (using the BitmapData class) is fairly quick on 4S+, so I don't think that is much of an issue (4S is closing in on being 3 years old at this point. Having old hardware means things run less than ideally, so anything older will just have to accept poorer performance)
Worker Documentation
Currently, the AIR beta (3.9) allows concurrency on Android but does not provide it for iOS
To solve this problem, or maybe even to do it more efficiently than AIR workers when they become available on iOS, is it possible to do concurrency via a native extension (ANE)?
I see the section "Threading" at http://www.adobe.com/devnet/air/articles/extending-air.html but it only leaves me a little more educated at my guessing :)
Let's consider an MP3 Player with visualization. Can an app be built such that the native extension reads the MP3 data, processes it, and hands over both the raw sound data and computed visualization for the actionscript layer to then play/display (and possibly manipulate the display further)?
I definitely think this is a legitimate usage of native extensions. We use threading in a few of the ones we've developed. It's a complex area to create a quick tutorial though but basically the iOS documentation on NSThread is what you should be looking into.
There's a good rundown on the concepts and some sample code here:
https://developer.apple.com/library/ios/DOCUMENTATION/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html
The major difference between this and the AIR concurrency is that the concurrency code is written in AS3 whereas with the native extension you'll have to write in native code for every platform you develop on.
Is there a framework that will allow to create web apps for iOS that will run as smoothly as native app?
I've checked demos of Sencha Touch http://www.sencha.com/products/touch on my iPad there's visible delay for touch events and for how precisely they are recognized. The feeling isn't the same as for native apps.
Is there other frameworks or technics that will allow to provide same experience as native apps?
It depends on your app. If your app is a hard-core heavy-duty 3D game, then no. If your app is primarily displaying static content ... like a web page or collection of photos, you might get close enough.
Think about what experience you want to achieve first. If you want a cross platform application and you want to avoid the stores (App Store, Google Play, BB App World), then by all means, consider a web app.
Other things to consider, how much data do you estimate the user will need store locally (HTML apps are more limited in this respect); how much functionality is lost when there is no network connection, and does this loss of functionality make the app unusable.
Like the answer by #RichardTurner, if you need the kind of performance you find in the higher end games (Infinity Blade or Modern Combat 3), then native is the way to go.
Figure what you want, then you will have better idea of what technology to use.
NO. Native apps will perform better every single time over web apps. If you want a smooth experience, go native. Also consider that some people have older model iOS devices and performance will be even more difficult to achieve on those devices in web apps.
Here are a few things to consider with a Sencha app vs a native application.
You were browsing a Sencha Touch application online and chances are it wasn't a "packaged" version so you would have to download each source file individually.
With Sencha, you can utilize Sencha CMD to package an application which essentially builds a single minified js file containing only the required components from the Sencha library and your application (smaller DOM). You can also look into a production version which takes advantage of appcache. You'll see some performance increases here.
A packaged native Touch application will contain the actual JS, CSS, etc. files as part of the applications source, so their is no downloading from external resources.
You have to consider that any HTML5 application is going to have a ~300ms touch delay, more on that here: http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away
I've recently heard about the converting feature of Adobe Air but how well does it work?
Does it emulate every bit of code a complex Flash game using tons of libraries outputs or should you expect a lot of work to go around if you were to convert one?
I'm thinking of making a complex cross-platform game but not sure which is better/easier, to use Flash and Adobe Air for its abundant game libraries, resources and faster development or to simply go with Java.
It Would really save lots of time if I can use Flash. Though, I can imagine it would also give me headaches to worry about all the time. Like what if adobe/apple stops supporting Flash or what if the converting feature won't work.
Any advice and any bit of information would be welcome. Thanks.
AIR works well on iOS in my experience although native apps will always perform better. I cant think of any aspects of Flash that wont work when converted to run on iOS.
Whether AIR performance is good enough really depends on the individual case - how gpu and cpu intensive the game is.
You have to consider the trade-off: use existing Flash skills to create a 'good' game quickly; or learn new skills to create a 'better' game slowly - is it worth spending weeks/months learning new skills to get a few extra percent of performance? Only you can decide that.
Regarding Adobes AIR support in the future; who knows - they dont have a great track record (think flash on mobile) - but i would suggest AIR will be around for at least the medium term, if not long-term.
My personal opinion is that "mobile" is not going anywhere and now is the best time to start learning Java for Android and/or Objective-C for iOS. Like PhoneGap, Flash mobile Apps don't give you complete access to the devices entire API/SDK options, even though what they do offer usually suffices. Flash is still a respectable tool but developing "native" gives you full control over your app's memory, device interaction, cutting edge APIs, etc ...
Depending on how optimized your action script 3 code is written, you may experience some performance issues vs utilizing native graphics libraries. I assume the latest version of AIR (I know Flash 11.2 and on included some nice graphic stuff) may address performance but haven't seen any benchmarks for AIR on mobile devices yet.
If you are hoping to go the AIR route, I'd say why not take a few days and try to port it over. If all else fails get a nice iOS or Android book and cuddle with it every night until you are confident you can recreate your App natively.
I have been hearing of the advent of html5 for iOS development. I know nothing about web dev technologies and am wondering, can this really be used for iOS game development? Just hearing html makes me think this will be used for web related apps, not things like graphically dynamic 2d games, but being unfamiliar, I'm hoping to get some insight from the experts here. Is html5 going to be useful at all for games, or should I basically expect to be sticking with the likes of cocos2d for iphone?
The short answer is "Yes, you can develop full speed, interactive games with HTML5". Check out "Private Joe", "Biolab Disaster" and "FUBAR" in the Apple app store. All were created with HTML5, Javascript, and a few javascript libraries (ImpactJS and Box2D).
One thing you'll see as you explore this is the repeated caveat that "web games aren't fast enough", also "Web games can't use the device's goodies - like GPS, vibration, etc."
These statements represent "common thought" and are not really true anymore. Companies like PhoneGap and appMobi have tools that make it possible to do anything in HTML/JS that can be done in native apps. Browsers keep getting faster, and smartphone processors also keep getting faster. Qualcomm's new chipset even has GPU acceleration for future smartphones.
As an added bonus from coding your app in HTML5, you will have the choice of whether to compile it app into a native app and post to one of the app stores (using appmobi or phonegap), or to offer it yourself as a web app (saving the Apple censorship and 30% tax).
Viva HTML5!
The real benefit to using HTML 5 for game development is that it's a write once, deploy everywhere strategy, meaning you can write the same code and have it work on iOS, Android, Windows, MacOS, Linux, etc, as long as it has a browser.
The HTML5 canvas element supports both 2d and 3d (on some platforms), so you can use it for complex games as well.
This will, however, run in a browser, so the only way to sell it in an app store is to wrap it in a UIWebView container or the like.
Also, there are games written in Canvas (just google it, also google 'chrome experiments' to find cool 3d stuff in HTML5).
I wrote this HTML5 Tetris implementation: http://htmltetris.com
It is designed to be equally playable on a PC and on touch devices supporting Javascript touch events.
One of the important things to get right in a mobile game is the control scheme and it took some thinking to come up with the swipe/tap control scheme used for Tetris here. But it turns out quite playable (in fact, just as playable if not more so than all of the tetris like iOS apps I have tried, and there are... quite a few of them) and is proof that it is possible to build a perfectly playable game with HTML5 technology.
Check out HTML5 Canvas. Lots of Web games are based on this tag. Here are some samples :- http://www.canvasdemos.com/type/games/
There are two great things about investing your time in learning HTML5 and its counterparts:
For one, every application that you write will theoretically be able to run on many platforms. iOS, Android, Windows, Mac, Linux, etc, all have HTML5 capabilities. You'll also be investing your time in a language that is still being developed, so you'll already know the ins-and-outs of it as more features are added, and you'll have mastered it when the final product finally goes mainstream.
The capabilities and power of HTML5 are only expanding, so the experience with the language should only improve with time ;)