15 February 2011
The Adobe Flash Platform comprises a set of integrated technologies that enable developers to build rich applications that run consistently across multiple mobile devices. This article discusses the tools and workflows that you can use for mobile development with the Flash Platform and what devices you can target. Keep in mind that this article is about what is available today.
At Mobile World Congress 2011 in Barcelona, Adobe shared the latest glowing statistics on the momentum and growth of mobile and tablet devices with Adobe Flash Player and Adobe AIR support. For example, there were more than 20 million Flash Player 10.1 installs in the first six months following its launch, representing 12% of all smartphones shipped last year. The market research firm Strategy Analytics estimates that for 2011 over 132 million smartphones will support Flash Player, representing 36% of all smartphones shipping worldwide.
Also, as of the end of 2010, developers and content publishers were able to deploy Adobe AIR applications to over 84 million smartphones and tablets running Android and iOS—a number that is expected to rise to over 200 million by the end of 2011. In the first two months following the release of AIR for Android, more than 1,500 applications were created and made available on Android Market.
Today, more than three million Flash Platform developers are able to use Adobe Creative Suite 5 tools to author content across a substantial number of devices for both Flash Player and AIR. Adobe is working hard to make mobile development easier, so expect to see more developments in the future.
From my perspective as a Flash Platform evangelist, there are three main categories of applications can you build using AIR, ActionScript, and Flex for mobiles devices:
This article covers Flash Platform development for Android, BlackBerry, and iOS devices.
In October 2010, Adobe launched Adobe AIR 2.5 on Android Market for "FroYo" devices i.e., devices running Android 2.2. Adobe also launched a preview release of the next-generation tools for developing applications for the Flash Platform: Flash Builder "Burrito", Flash Catalyst "Panini", and the Flex "Hero" framework.
Once you download the Flash Builder "Burrito" pre-release from Adobe Labs and install it, you are ready to create Android apps using either ActionScript or Flex. You can use Flash Builder to develop your application, as shown in Figure 1, test it on your computer using an emulator, deploy it to your Android device using the USB cable, and debug it while it's running on the device. When you are ready to submit the application to Android Market, you can use the Flash Builder Export Release feature to build the APK file. Of course you can use Flash Professional CS5 too.
On Android, AIR applications use the AIR runtime installed on the device. What happens when a user decides to install an Android application built with AIR but doesn't have the runtime installed? The installation process proceeds as usual; when the user starts the application a message appears that explains that Adobe AIR is required for that application. When the user clicks Install, the runtime is installed like any other Android application.
I'm frequently asked if it is possible to package the AIR runtime with your AIR application. The answer, at this time, is no.
The Flex "Hero" pre-release enables you to easily create Android apps by adding new components specifically designed for mobile devices and by optimizing existing components. It provides, for example, support for screen management: your application can have the UI split between multiple screens with only one visible. Read Narciso Jaramillo's article, Mobile development using Adobe Flex SDK "Hero" and Flash Builder "Burrito", to bring you up to speed. To learn more about debugging your code, you can watch my friend Ryan Stewart explain how to debug Adobe AIR for Android applications. Also check out other Android-related articles on the Adobe Developer Connection.
API support is available for the following areas when building AIR for Android apps:
Finally, you should be aware of two apps that can help you get started with Android development. As shown in Figure 2, Tour de Mobile Flex is an Android app built with AIR and the Flex "Hero" pre-release, and Adobe AIR Launchpad is a desktop application that creates a Flex project ready for importing into Flash Builder with Android permissions set.
Major publishers like National Geographic, Dennis Publishing, Martha Stewart Living, and Condé Nast announced at Mobile World Congress 2011 that they are using Adobe Digital Publishing Suite to create and distribute their content on Android tablets. By employing the new Content Viewer for Android, publishers can significantly expand the reach of their material across the broad range of Android tablets that are expected to come to market soon, led by the much-anticipated Motorola Xoom.
With the RIM announcement of the BlackBerry PlayBook, the Flash Platform has been extended once again. Much of what I said about AIR for Android development is also true for BlackBerry PlayBook development. RIM integrated AIR as a core part of the OS for this device and this makes us Flash developers quite happy.
There are a few differences compared to Android development with AIR. You need to use the BlackBerry Tablet OS SDK and simulator. After you've downloaded and installed them, you're ready to start developing apps with Flash Builder "Burrito", as shown in Figure 3. To learn how to set up Flash Builder for PlayBook development, watch Ryan Stewart's tutorial, Getting started with the BlackBerry PlayBook and Adobe AIR. The latest SDK comes with a BlackBerry Torch browser so developers can not only test their AIR apps but also begin testing their Flash websites
If you want to make your application look like the native BlackBerry PlayBook apps some of which are actually created using AIR you can use the BlackBerry Tablet OS SDK for Adobe AIR. This SDK provides a library of UI classes that are the same classes used by the PlayBook itself. It also enables you to package and deploy PlayBook applications .bar files to the PlayBook simulator. For example, using the SDK you can access the battery level or get a notification when a low-memory event occurs. For details on these APIs, see the BlackBerry Tablet OS SDK for Adobe AIR API Reference. On his blog, fellow evangelist Renaun Erickson has posted a number of tutorials on PlayBook development. In a nutshell, you can develop applications using Flex "Hero" or just ActionScript.
As in the case with Android app development, you can develop apps using Flash Professional CS5 if you want. See Junchao Ji's tutorial, Building an AIR application with Flash Professional CS5 and the BlackBerry Tablet OS SDK, for help getting started. Ben Forta's post, Building RIM PlayBook apps in Flash Professional, also explains how to set up Flash Professional CS5 for BlackBerry PlayBook development.
Adobe is working with RIM to make it easier to build apps for the BlackBerry PlayBook with Flex, so stay tuned. Lastly, you may be interested to know that RIM is offering a free tablet for developers who create a qualifying application that gets accepted into BlackBerry App World.
The Adobe Developer Connection consolidates much of this BlackBerry Tablet OS information to make it readily available.
Historically, iOS is the first mobile platform that Adobe supported. Adobe announced this at Adobe MAX in 2009 and released the Packager for iPhone in 2010 as part of the Adobe Creative Suite 5 launch. If you want to develop applications for iPhone, iPod touch, and iPad, you can use Adobe Flash Professional CS5 Packager for iPhone, which is a feature of Flash Professional CS5 and and the Adobe AIR SDK 2.0.1. Just make sure that you install the Flash Professional Update for iOS. See the Packager for iPhone page on Adobe Labs for download details and more information. After you have everything set up, you will have access to a new type of iPhone OS project, as shown in Figure 4.
You can debug the application within Flash Professional using the AIR Debug Launcher ADL. You can also debug directly on the device the iPhone or iPod must be connected on the same Wi-Fi network as the computer on which the debugger is running. To learn how to set up Flash Professional for building iPhone apps on Windows it is simple on Mac OS actually I recommend watching Lee Brimelow's screencast on the subject. Also see Christian Cantrell's blog, where you'll find many posts about iPhone development using ActionScript, as well as iOS-related articles on the Adobe Developer Connection.
API support is available for the following areas when targeting iOS devices:
Here are some features that are not supported today:
Also, you cannot execute code from a SWF loaded at runtime because there is no virtual machine you can, however use assets such as images or animations. Basically in order to create an iOS app, the AIR runtime is compiled together with your application code into iOS native code. This is the biggest difference between iOS apps and those developed for Android or BlackBerry; for those devices, the AIR runtime is installed on the device.
While it is technically possible to write your application using Flex, I strongly suggest you use ActionScript for now. Today, Adobe is requiring AIR 2.0.1 for iOS. Android and BlackBerry, however, are running AIR 2.5. The Flex "Hero" pre-release—the current Flex framework version under development with support for mobile development—requires AIR 2.5. Adobe is working to bridge this gap.
Today you can use the Flash Platform to create applications for Windows, Mac OS, and Linux desktops, and apps for iOS, Android, and BlackBerry Tablet OS devices. Working with partners in the Open Screen Project, Adobe will be bringing the Flash Platform to Windows Mobile 7, Palm webOS, and MeeGo/Symbian—in other words, full-web experience and rich applications across smartphones, tablets, and other devices.
Of course, moving AIR applications from desktops to devices is not always a straightforward task. However, if you architect your application carefully, this task can be fun. Christian Cantrell and Serge Jespers have posted some good examples on this subject.
For more examples of popular AIR applications for Android and iOS and the broad variety of content running in Flash Player, visit the Adobe Flash showcase for mobile.
Meanwhile, the recently released Flash Player 10.2 supports innovative new features including Stage Video, which delivers much improved video performance through optimizing hardware acceleration on mobile devices, desktops, and TVs.
I hope this article has made you curious enough to try out mobile development with the Flash Platform. Visit the Mobile and Devices Developer Center on the Adobe Developer Connection to find many resources to help you master mobile development.
Keep an eye on my blog too because I'm planning to write more on the mobile front.