Here is a simple Employee Directory application I wrote to demonstrate how to build Flex applications for Android using the AIR runtime.
Watch the video:
The key point when you look at the source code of this application is that you build Flex applications for Android the exact same way you build Flex applications for the Browser and the Desktop: same programming model, same language, same tools, same code. This application for example uses a local SQLite database on your device that you access using the same database API you’d use for any other Flex application running on the AIR runtime.
The other good news is that you have access to additional APIs (GPS, accelerometer), and you can integrate with other applications on your phone (dialer, SMS, email, etc).
21 Comments
Tried it on Motorola Milestone (Droid) running Eclair.
It works fine, thank you for sharing. Anyway the “ListView” suffers of slow scrolling. I think it’s due to the lack of hardware acceleration on this Air Prerelease.
Wow.. Thank you very much for sharing this code.
Really interesting and encouraging … ;)
Keen to surf more on this series..
It’s so exciting to integrate Air/Flex app with Android. I am starting to code with your sample immediatelly. Thanks for sharing again…
Very good. One of the best articles about this theme I ever read.
Hi, Christophe. Thank you very much for your shaing!
I have some question about the source code:
1. On the instruction “Developing Adobe AIR Applications for Android” (by Adobe), page 12, it is said that the “Main application file” should be .as file rather than .mxml. However I notice that in your source code the main application file is a .mxml file(“EmployeeDirectory.mxml”). This make me confused?
2. How can I package your application in the EmployeeDirectory.fxp file(under /bin-debug) to a .apk file? or should I convert the application to another format such as .air first?
I am in China, so I cannot watch your video on youtube, in which maybe the questions have been answered.
Looking for your reply!
Thank you!
Christophe,
Thank you very much for sharing this.
1) Installed fxp in flash builder, compiled and installed on HTC Desire(Eclaire). Error view. Is there a way to find the error code?
2) Confused because I undertood only as3 was supported for the moment.
3) Going to try your apk file.
4) @sher: Import the fxp-file into flash builder. Then follow the instructions in the adobe pdf.
Installing your apk gives Errorview too on HTC desire with Eclaire. Where can I find the error codes?
Its very good to hear that Android 2.2 now supports Flex 4. I have a querry , I would further request you to clarify me. I have developed a Flex application on windows a couple of months ago( Windows XP , Flex 3) Currently my client wants the same application on Android, Can it possible. let me know in case you need any details on my end.
Let me also know the License part of Android.
I have a flex application running on Firefox and want it to run in Android browsers,is it directly portable to Android browser or need to do any scaling or skinning for compatible?
Very very cool. Have been looking forward to building on Android using as3. The time has come, LET THE GAMES BEGIN! :-)
hai,
i tried running this application in emulator but i am getting the following error, i had got the info from the dalvik debug monitor.
Log:
06-07 15:15:14.492: WARN/InputManagerService(51): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43bcf3d8
Please help me in resolving this i am unable to run any app in the android emulator.
Very very cool.
welcome to my site:http://www.bagicon.com
Thank you!
hi,
your application crashs on emulator with AIR 2.5
Source not working…
Hi,
Very cool app…..
However, liked fisher asked, how is that you are using .mxml while the PDF on the AIR prerelease says that, .as must be used.
Your help is very much appreciated
Ram
I worked alot tryiing to run this app on android emulator but its useless, if any one had suceeded int his process please let me know.
i even rebuilt the app but no using flash builder with source code but no use..
thanks,
Shyam.S
Hello Respected Sir,
i open this application ‘Employee Directory.fxp’ in Flash Builder and sdk i use Air 2.5 for this project, But it show an error every time.
Please tell me the solution.
Thanks
Main app doesn’t have to be AS file, if you are using Flex 3, not working with Flash Builder 4 yet.
I was writing my game in Flex 3, SDK 3.1 with AIR 2.5
my UI is wrote in MXML, all controllers are in AS3.
works fine in 2.2 emulator.
http://www.flexcode.org/flex/sudoku.apk
This is cool…i didnot know that flex would work on Android phones (as i thought its heavy) but it works great…..
Hi Christophe
Yesterday (30 June) has been released the flex sdk update that updates the flex from version 4.o to 4.1 which adds AIR 2 and Flash Player 10.1 support to flex
Does this version of the Flex SDK support the mobile (particulary Android 2.2) development?
Or we need continue to use the AIR SDK 2.5 from https://prerelease.adobe.com in order to develop mobile applications?
What about the next version of the flex sdk “Hero”? Will it incorporate AIR SDK 2.5 for mobile development?
Regards
Geo
Hi Christophe,
Maybe you can clarify something for me. We use Flash Builder 4 for our web and desktop apps. I noticed in your application, you use both ActionScript and MXML files. In reviewing the recommendations on the Air for Andriod pre-release site, they are suggesting that applications should only include ActionScript since Flex is not optimized for mobile devices. Obviously, you’ve proven that it works, so is their warning simply a suggestion or is there a technical reason why MXML should not be used?
Obviously, Adobe is addressing the mobile market with Hero, but that is a near-future solution. Can you provide some insights into what is possible now with MXML so that we can leverage re-use of existing components for our Android apps? Is there a different recommendation when considering a Flash vs. Air app on Android? We’re at the beginning of a new development cycle, so we can make these decisions fresh and not have any old baggage. But we need to have some demonstrable Android solutions over the next couple of months.
Thanks for your insights.
Tom
5 Trackbacks
[...] Direct Link [...]
[...] Christophe Coenraets has posted some great Flex mobile demos. Check out his Employee Directory and Stock Trader [...]
[...] Christophe Coenraets recently blogged Employee Directory app built with Flex on AIR for Android: [...]
[...] partner to work with. For example Christophe Coenraets has recently published a post concerning a Employee Directory beta application developed with AIR for the Android platform. And like this most most Adobe announcements are in [...]
[...] I finally took the time to rebuild the Employee Directory application with the latest version of AIR for Android (available here) to run on Froyo. See the links below to download the apk and the source code. (If you are still running Eclair see my original post). [...]