Will a Flex app run on a mobile device? - apache-flex

Can a Flex application that was designed for use on a PC be run on an iPad, iPhone, or Android-based mobile device?
Seems like a simple enough question. Visiting http://www.adobe.com/products/flex.html yields a picture of a dude running a (presumably) Flex application on an Android. So at first glance, the answer would appear to be "yes." End of story.
but yet…
There is so much (mis)information out there on various tech sites that suggest Flash-based technologies simply won't run on iOS or other mobile platforms. Why is this? Perhaps they mean to say that Flex won't run "out of the box" and requires a plugin? Or do they mean it won't run at all?
Every time I think I've reached a definitive conclusion, some post on SlashDot or CNET directly contradicts it. So what's the scoop? Can one take an existing Flex application and run it on iOS/Android? (I realize there are screen size issues to consider so the app might not run effectively. I just want to know if the runtimes are available on the mobile devices to allow the Flex app to launch at all.)
Sorry for the noob question. My background is WPF / HTML5. Adobe technologies are completely foreign to me.

I wrote a lot below if you'd like to read it enjoy, if not sorry for taking your valuable bytes :) I directly answered the questions up here first:
Why is this?
It's a confusing matter read below for the why details.
Perhaps they mean to say that Flex won't run "out of the box" and requires a plugin?
Or do they mean it won't run at all?
Using the flash builder tools (the bin folder in the SDK) you can compile for native desktop application, desktop web browsers, native iOS application, native Android application. Android with FlashPlayer plugin installed will show Flash content within the web browser, iOS will only run the ones compiled with AIR, not in the the web browser but as a native app.
Every time I think I've reached a definitive conclusion, some post on SlashDot or CNET directly contradicts it. So what's the scoop? Can one take an existing Flex application and run it on iOS/Android?
Yes, if using AIR and run as a native app on all three platforms (the desktop Flex API is for the most part a superset of the web Flex API), your other points about performance and form factor are valid and should be considered though. The nice thing is you can write your model/controller code in a common library in AS3 then write separate presentation layer interfaces that all share the library.
Here's the very long version:
Using the flash compiler results in "bytecode" in the form of a file with a swf extension using the swf format, you can read a ton more about that here:
http://www.adobe.com/devnet/swf.html
To interpret the file you need some sort of run-time similar to some degree to running WPF/XAML/C# within a .NET framework context (either desktop or using silverlight on the web). In the case of adobe technologies (rough equivalence):
AS3 = C#
MXML = XAML
Flex = WPF+WCF (client side RPC not server side)
Flash Player = Silverlight
AIR (Adobe integrated runtime) = .NET
Framework Redistributable .dll(s)/.so(s) for desktop OSes
(Read this list very loosely please, I know XAML is preserved in the MSIL or whatever which is different because MXML is compiled to AS3 and only if a debug flag is set on the compiler does it include the debugging symbols, there's certainly tons of differences but I think this is an easy and correct enough model to use)
On iOS the browser does not allow for plugins in the traditional sense of netscape browser plugins or ActiveX plugins. For this reason you'll not be able to execute a plugin ie flashplayer or silverlight in the browser. Since Adobe did release a flashplayer for Android devices that does run in the browser it will work on those devices in the browser, however they have essentially thrown in the towel for supporting this long term, as they have to support the majority mobile device platform, iOS, in order to remain relevant (this was I think more a collective throwing in of the towel by Google, device manufacturers, carriers, Microsoft, all just following suit and trying to make the best business decision, WebKit and V8 or SpiderMonkey can probably do 99% of what Flash can do and better in some cases and WebKit will hopefully not splinter and will remain open source... frameworks and the browsers just need to get fleshed out and stabilized).
If the user installs AIR (or the runtime is packaged with the app) then a Flex/Flash (that is stuff coded in AS3 and/or MXML and compiled to a swf) can be transcoded/packaged to be interpreted by the run-time for that device correctly (be it iOS or Android or whatever RIM did, I don't think they have AIR for Windows Phone 7 and Win8 on ARM won't support browser plugins either). Part of the confusion is possibly from the fact that Apple denied the distribution of Apps that were "cross-compiled" which kept AIR out of the list of options for iOS for a good year, just after Adobe started announcing it was usable for that purpose (kicking Adobe while their down). Another part of the confusion probably comes from real vids of people who have 1 hacked their device or 2 were able to get open source alternatives to the flash player run-time to work on their iOS device (gnash was one I'm aware of from some occasional Linux tinkering, also possibly FAKE vids).

You can run Flex applications on mobile devices, but you cannot simply run any Flex project.
In Flash Builder ( Flex Ide) or in Flash Professional you can create mobile projects. These projects generate native applications for iOS and Android.
Last time I tried, the result and the available components where less than what I expected. So, if you can, I'll much recommend you go for something like Appcelerator.com or similar, which turns HTML5/Js code into native apps. I tried them, worked a lot better than Flex.

Short answer: No
Long answer: You can use Adobe's tools to compile your Flash/Flex app for use as a native iOS app. So you won't be able to embed the app in a web page like you normally could with Flex, but you can build it as a native app. Note you have to have Flash Builder 4.5 to do this.

It won't run on iPhone as a .swf file, but it will run on Android based devices that have adobe flash installed. It will also run on the BB playbook, which also has flash.

Flex is a framework.( Anyway it is very beutiful one which even sometime looks like complete different language ).
As soon as you are building AIR application it can run on various platforms like : Windows, iOS, Android, upcomming TV's, PlayBook, even .. into the future ( maybe/hopefuly ) on Windows Phone, plus Linux ( which AIR future is not very clear anyway ( but hopefuly Adobe will reconsider ) ).
So - application created with Flash Builder 4.5+ would probably run everywhere as soon as it is AIR application.
The compilation methoods is really simple, and you almost simultaneously compiling for everything you wanna to.
And one of the most important things here - your applications will run, work, look and feel the same way you were designed on one device. Flex is the thing which is responsible for everything to looks beutiful on each platform it is running.
For instance i am compiling currently for Android, and without even test i can clearly say that it will looks and feel the same way under iOS and Windows, and it will.

Related

How to port my existing Flex3.6 application to mobile iOs, Android platforms

I have a Flex web application which uses Flex 3.6 sdk.
What are all the ways to port this application iOs and Android devices.
Before the release of Flash builder 4,
I have converted my Flex 3.6 project to AIR 2.0. (Which required very minimal code change)
and used some command line tools to package it to .ipa and .apk.
Sucessfully deployed it on a iPad. Application worked as expected.
This is all I remember, I totally forgot about the procedures that i followed as it was before two years.
Now in Flash builder 4, There is a option to create "Mobile Project" which exports the application for different mobile platforms just by Rightclick on project - Export - Release Build .
but this page tells that
"Except for the MX charting controls and the MX Spacer control, mobile applications do not support the MX component set defined in the mx.* packages."
Now I really confused which approach to follow.
Can some one please clarify on these
What are all the ways to port Flex3.6 web application to iOs and Android devices.
Do I need to convert my Flex3.6 project to Flex 4 project with all MX components changed to Spark components (This requires major change in my project) for mobile platform support.
Is there any other ways to port my existing Flex3.6 application to mobile with very minimal code change.
(I understand that changes like UI size, etc needs to be taken care)
Thanks.
First of all, I don't think reusing your web application as a mobile app is a very good idea from a user experience point of view, unless the interface is extremely simple (which wouldn't warrant a full blown Flex application in the first place).
the screen size is so different that it would probably be unusable, or at least uncomfortable
you have no touch interactions defined
But to answer to your questions: the mobile components are a completely different component set. They are more lightweight and optimized for mobile interactions. To achieve this gain in performance they were based on the Spark architecture. Which means that:
There is no way to port your Flex 3 code
Yes, you'll have to convert
I can't think of any other way to port your application; minimal code change is out of the question
conclusion
Both the fact that it is technically impossible to automagically port the application from web (Flex 3) to mobile and that - even if it was - it wouldn't be recommended because of UX concerns, lead me to this suggestion: rebuild it from the ground up, both taking care of clean, optimized code for mobile and designing a UI that is appropriate for the targeted platform.

Differences between Mobile & Desktop AIR

Ive tried asking on the blackberry forums with no luck... Maybe there are some Blackberry/Adobe experts here...
Im just about to start a project using Adobe AIR/flex for the Blackberry Playbook, I have a few questions:
If I develop an application for the playbook, will the same application be able to run on a desktop? If so will there be any differences?
What is the difference between the desktop and mobile libraries? Can I only access a subset of the SDK on the mobile device compared to the desktop?
Can I create a playbook application that can call methods to a JAVA back end, located on my server?
Thanks
Phil
What’s different about developing a
mobile application versus a web or
desktop application? While many
existing Flex concepts and patterns
carry over directly to mobile
development, developers will need to
take into account the differences in
interaction patterns, screen real
estate, and performance
characteristics of mobile devices
compared to desktop computers. As a
result, we recommend using the new
mobile features in Flex to craft UIs
specific to mobile devices, while
sharing underlying model and data
access code with your desktop or web
application. Additionally, we
recommend certain best practices when
developing mobile applications with
Flex, such as using ActionScript and
FXG rather than MXML for creating item
renderers and skins.
Taken from http://labs.adobe.com/technologies/flex/mobile/faq.html#differences
As per my usual qualifying statement: I haven't tried this. Since this is of some interest to me and I've got a bit of free time I'll give making a hero app and running it as a desktop app versus as a mobile app a shot and post back here once I have it working or find a wall.
The runtime: Adobe AIR 2.5 on mobile
devices The initial versions of the
mobile development features in "Hero"
and "Burrito" are targeted at creating
standalone installed applications
using the Adobe AIR runtime for mobile
devices. By focusing on AIR, Flex can
take full advantage of the integration
AIR provides with each mobile
platform, such as the ability to
handle hardware back and menu buttons
and to access local storage.
Running on AIR Finally, it's important
to realize that in addition to all the
mobile Flex components listed above,
you can also directly take advantage
of all the APIs that are available in
AIR on mobile devices—geolocation,
accelerometer, camera integration, and
so forth. While some of these features
are not exposed as Flex components,
they are easy to access directly using
ActionScript. For more information on
developing using the APIs provided by
AIR on mobile devices, see AIR mobile
docs.
http://www.adobe.com/devnet/flex/articles/mobile_development_hero_burrito.html
Basically it's looking like the answer to all the questions is positive.
Yes and likely yes. (as they re-iterate throughout anything I've found on the topic the controls in Hero were made specifically for touch, taking into consideration the fat finger vs the mouse pointer, my guess is it will render slightly differently on the desktop and it's best to actually develop the UIs separately, although the web-services/model can be combined into a shared library/project)
You should have access to everything provided to the desktop (plus info from GPS/accelerometer etc., but obviously wouldn't get those on desktop), but don't have nearly as good a processor so what will work on the desktop may not on a lower performance computing device, but for low resource consumption tasks this shouldn't be a worry.
Yes this is a core feature of Flex, I don't see how it would be possible to make a (useful) RIA without web services. For confirmation on this one look no further than Adobe TV: http://tv.adobe.com/watch/adc-presents/flex-mobile-part-1-beginning-a-mobile-application/ <-- that app is using a web service (doesn't really matter to Flex what the underlying server technology is so long as it can make HTTP requests against it, RemoteObject/AMFService should serve your purpose)
If I develop an application for the
playbook, will the same application be
able to run on a desktop? If so will
there be any differences?
Depends. the Air file for both desktop and Playbook is exactly the same, however for Playbook development, RIM has provided an Air library so that Flex developers can take advantage of the hardware further than just the normal Air capabilities. With that said, if your application is dependent on that extra library, it will not work on desktop.
What is the difference between the
desktop and mobile libraries? Can I
only access a subset of the SDK on the
mobile device compared to the desktop?
Desktop and mobile libraries? Do you mean the Playbook Air Library or something else? See above for the latter. Comment on this if you can clarify.
Can I create a playbook application
that can call methods to a JAVA back
end, located on my server?
Yes, you can, as long as you have internet connectivity on the Playbook.

New web app that I would also like to port to Android - The question is: Air or Flex?

I'm very familiar with the Adobe Air runtime, and quite handy with the workings of a Flex application, but I'm unsure which technology I should use if I would like to have a multi-platform application able to be deployed to the Web foremost, Android Phone secondly, and Desktop third.
I understand that AIR is probably the route I should go, but I'm very conflicted on how integrated it is with Android? Is it easy to do now, or still a headache (I haven't read about it in ages)? I've seen the new Flex 4 deploying to Android very smoothly, but I've heard it's difficult to write an AIR program with Flex.
Any thoughts are appreciated!
You have me scratching my head here.
AIR is a runtime, not an application development framework.
Flex is an application development framework, not a runtime.
You can author your application in Flex and deploy it via Flash to the phone and web and deploy it to the desktop with AIR.
Now, if you were implying that you would develop your web app using HTML/JS/etc..., deploy that to the desktop with AIR, and then try to rewrite the whole thing in Flex, I agree... that's not a reasonable approach.
My advice is that you stick to one stack.
So, if you're going to do Flex, do Flex all the way. If you're going to do standard web stack, do that all the way (there are a lot of mobile web dev frameworks out there - jQuery Mobile is probably one of the better ones, but Ext.JS/Sencha is out there too).
Make sense?
I have not tried it, but Adobe acts as if it's fairly simple to adapt from straight Flex to Flex within AIR.
What's more important is what language the app is already in. If it's in JavaScript and HTML, then it would stand to reason that adapting that to AIR's HTML5/Javascript engine would be quicker and less frustrating than porting it to Flex and adapting it to AIR.
Additionally, it gives you a codebase you can more easily adapt to iPhone if you want, using PhoneGap or Titanium, which are HTML5/Javascript based as well.
I've had a couple of projects end up withering on the vine because I went back and forth between technologies (and in parallel allowed feature creep to make them more and more monolithic and daunting undertakings). So, IMO, the development paradigm to use is the one that will allow you to spend more time coding and less time second guessing yourself.
I want to clear up some confusion:
I understand that AIR is probably the
route I should go, but I'm very
conflicted on how integrated it is
with Android? Is it easy to do now, or
still a headache (I haven't read about
it in ages)?
AIR is very integrated with Android through the runtime, officially known as "AIR For Android". Adobe released it recently and people already have applications in the Android store. The tooling introduced in Flash Builder Burrito makes it very easy to build Flex applications for Android. I expect Burritio to become a formal release early next year.
I've seen the new Flex 4
deploying to Android very smoothly,
but I've heard it's difficult to write
an AIR program with Flex.
It is borderline trivial to convert a Flex application to an AIR application. However, switching a "standard" Flex or AIR application to AIR for Android will most likely require code optimization due to device resources. I would anticipate sharing 60-80 percent of the code base, but the UI will most likely require rework because of the smaller screen size and component management will have to be done differently because of memory / processor requirements on a mobile device.

Adobe Air - How to make a hello world?

I am using Fedora 12 (linux) Installed Packages adobeair.i386 2.0.2-12610 #adobe-linux-i386.
I want to make a simple "hello world" application which is able to run in my desktop and also via http://localhost/air/index.php
Can someone please show me step by step, a working example?
Thank you
Regards
N.B: What are the differences between Adobe Air and Adobe Flex? Can you share please, seems very confusing, i could use C++ (which is Air) and i could use PHP (which is Flex), like that kind of difference?
The AIR app won't work in a browser. For the web version, you would use Flex and for the desktop version you would use AIR. Both applications can be written in Actionscript 3 however, unlike Flex apps, AIR apps can also be written in HTML/JS. If you write your apps in Actionscript 3, your Flex and AIR apps could use almost identical code. Obviously, there are a few classes which can only be used in AIR as these related to desktop functionality. If you look at the Actionscript 3 reference (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/), you can see which of the classes are AIR only and which can be used in both Flex and AIR.
AIR files are exported as .air files while Flex file are exported as regular Flash .swf files.
As far as, "C++ (which is Air) and i could use PHP (which is Flex)", that is sort of right. AIR is a replacement for C++ in that you can write desktop apps with both. However, because of the AIR runtime, you do not have to write different versions for different operating systems. the one AIR app will work on Windows, Mac, Linux and now Android phones. With C++, you'd have to modify your codebase for all of these environments. Flex is not like PHP however, it's client side so is more like a more-powerful Javascript. You can have a Flex app talking to a PHP backend (using AMFPHP or Zend_AMF to communicate) which handles all the server-side stuff like retrieving data from a database and sending it back to the Flex app running in the browser on the client. Flex is sort of like a collection of components (it's officially an SDK) to make writing web apps easier. So, for example, there's drop-down menus, date-pickers, datagrids, trees, video displays, etc, plus everything else that's available in Flash. IMO, the best thing about Flex development over HTML/JS development is the layout model. You can make some very complex fluid layouts very easily in Flex which adapt to different screen sizes. You also don't have to do much in the way of cross-browser testing - it looks the same in all browsers on all OSes as long as the user has the approriate Flash Player. It's also very fast when handling lots of data and makes it easy to mix many different multimedia components, video, audio, etc, in the same app. Some good apps written in Flex are Aviary, Photoshop.com and Buzzword. Some good AIR apps are the eBay desktop client, Feedalizr, Seesmic Desktop, etc.
This could've been solved by googling "adobe air tutorial hello world", but here's the link to Adobe's official air beginner hello world tutorial: http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7ecc.html

What technology for a rich UI desktop application?

For an internship, I'm gonna have to develop a desktop application. The focus is creating a rich UI ( cool effects, sound etc ). Which tech should I go with ?
- Flash ? ( in this case, shoud I go with a flex project ? AIR ? what is the gain between this and a simple raw flash project )
- C#/Silverlight ?
Any other possibility ?
If experienced developers could give their advice, that would be great thanks.
The best technology to use is probably the one you're most familiar with, unless you mean you're going to be learning on the fly. But for the various options I'll take a stab.
Flash itself (the runtime) is a browser plugin, so that's not what you want, but if you build your application in Flash or Flex (the authoring tools), then you can publish it as an AIR application. AIR is also a runtime - basically it's Flash, plus a bunch of extra APIs for running outside the browser. The advantages to making an AIR app are:
The same app runs on win/mac/linux
You can make it with the same skills/tools you use for Flash (dubious utility if you don't have those skills/tools, of course)
Close tool integration with other Adobe tools (photoshop, after effects, etc.)
The main disadvantage is incomplete access to native (i.e. OS) capabilities. The way a runtime allows you to run the same app on win/mac/linux is by restricting you from doing some of the things that you could do with a native application.
As for Flex, whether you use Flex or not is a separate question. Flex is a framework within Flash - an AIR app can be made using Flex or not using it. Basically, if you expect your app to have a lot of controls, slider bars, charts, accordion panels, etc., you might look into Flex. If you expect it to have a lot of animations and pictures and sounds, plain-old-Flash may be better.
Apart from Flash, the other main choice for a runtime is Silverlight. The advantages there are, to be honest, basically the same. You use .NET instead of ActionScript, and the tooling integration is with MS' Expression suite instead of Adobe's creative suite, but the development process and the results are quite similar. The choice between AIR and Silverlight is really a choice between Adobe tools and MS tools, and between two programming languages of entirely comparable power. Most everyone simply uses the one they're more familiar with.
Finally, the other set of options is not to use a runtime, and to simply compile an app from any language/development environment you like - C, C++, .NET, Python, anything. The advantage here is you get (in general) full access to OS capabilities. The disadvantages are, you (in general) need to do extra development to run on multiple platforms, and also I don't think you'll find a language/environment that lets you work with multimedia as easily as you can in AIR and Silverlight.
Depends what programming languages are you proficient in. If you are .NET/C#/VB.NET guy go with SilverLight or WPF. If you know ActionScript, go with Adobe line of products.
My preference goes to the (slightly) most opened universe. Assumed that you know how to write Object-oriented programs, Adobe is using Eclipse as a base for his tools, using plugins.
Actionscript is just like Javascript syntax. You just have to learn the flex 4 libraries.
Then, publish you app as an Air desktop application that can run everywhere. Really everywhere
The only thing to know about MS tools and languages and libraries is that they are very well designed and usable. and it runs on Win and mac also. and Only.
If the main request is to have a rich UI the simplest approach is to build a Flex application running under Adobe AIR platform. The answer to the questions Flash or Flex is very simple: if you are a designer go with Flash, if you are a developer stay away from Flash and use Flex. The Flex framework was created for developers, and is really hard to replicate all its features in Flash (think only what you have to do in Flash if you want to resize your app).
On the other hand if you are coming from a .NET background it will make more sense to stick with Silverlight/C#
I'm not sure if this helps but I'm developing in Flex and now I have started to learn Silverlight and I can say that developing in Flex Builder is much more faster then developing in Silverlight( Visual Studios ) . For me Flex Builder is much better because you use only one IDE to develop both back and front end. And that's when it comes to web development. If you want to do desktop applications then you do the same thing and a plus is that you get everything in only one file. You also have a small SQL database that comes with it.
But on the other hand when you develop in Silverlight you have to use several IDE's or tools outside Visual Studios to make awesome graphics. But if you want to have more time for design then I would suggest to use Flex Builder and not Silverlight.

Resources