Last week was really exciting for everyone at Adobe as we released AIR for Android into the wild. There are already a ton of apps on the Android Market and there are going to be some really nice ones coming. One thing that I have noticed is that there is still a lot of confusion surrounding what AIR is and why it is useful. Now people who frequent this blog should know what AIR is, but there is the question of when you should use AIR.
I have also noticed several Java developers making comments like “just learn Java and make native applications.” This brings up a very important point. Adobe AIR is not meant to be a replacement or competitor to native Java on Android. There are absolutely times when using Java is either required or at the very least is the best choice. I personally have been learning native Android development side-by-side with AIR and I recommend people to do the same, assuming you have the time and/or interest. Let’s take a look at some of the situations where building a native application is appropriate.
Native UI Controls
There are many native UI controls available in the Android SDK. Most of the applications on the market make heavy use of these. They range from buttons, lists, form controls, layout containers, and much more. If you develop your application using Adobe AIR you will NOT have any access to these controls. The best thing you can do is to try and fake them, but from my experience it is never quite as good. So if you want to use native controls then you must go native.
Android API Access
The AIR team has done a great job of giving you access to a lot of the core Android APIs like camera, microphone, geolocation, etc. With that being said, there are a whole bunch of APIs that you will not have access to, particularly lower-level functionality. We will be adding more access as time goes on but you will have to wait for us to implement them before you can use them. So if the AIR runtime doesn’t provide an API you need then you must go native.
Once you start developing AIR for Android you will notice that the performance is amazing. There is hardware acceleration support as well so you can build some pretty intensive applications without any problem. With that being said, nothing can match the performance of a native application, particularly one that takes advantage of Open-GL. So if you are building some crazy 3D game or intensive graphics application you may be better served going native with Open-GL, assuming you have the skills for that (it ain’t easy).
I love Android widgets. To me it is one of the main selling points over other platforms. I am pretty bummed out that you cannot build Android widgets with AIR. This would be a sweet spot for Flash developers as we know how to make some amazing looking stuff. I have put in the request to the AIR team to add this support but we’ll see what happens. So if you want to build widgets you have to go native.
So those are some of the situations where building your application using Java would be a better choice. There are of course some huge advantages when you use AIR. Firstly, you don’t have to learn Java if you don’t want to. Secondly, you can deploy the same app to the iPhone, the web, and other devices soon. It is all about using the best tool for the job. The bigger your toolbox the more likely it is you will choose the right one.
As a little side-project, I will soon be recording some gotoAndLearn-style video training for native Android development. Look for details here soon on that.