- Getting started with Adobe AIR for Android
- Articles this issue
- Setting up your development environment
- Building mobile applications in Flash Professional CS5
- Deploying your first application
- Now you’re a mobile developer
- Adobe Air APK for Android
- A free cross-platform app development tool
- What is Adobe AIR and why do I need it?
- How can I create 3D games using Adobe AIR?
- Does Adobe AIR support bitmap?
- Offers HTML and Flash integration
- Can you extend Adobe AIR?
- What are the benefits and drawbacks of using Adobe AIR?
- How much does the Adobe AIR download cost?
- Are there any alternatives?
- Should I download Adobe AIR?
Getting started with Adobe AIR for Android
by Brian Rinaldi
Articles this issue
Mobile development is sexy — there’s no denying that. But for someone like me, who generally focuses on back-end development or behind-the-firewall Flex applications, building a mobile application sounds intimidating. I can’t pinpoint exactly why, but I also know I am not alone. However, with new Adobe AIR for Android (currently in developer prerelease on Adobe Labs) and the Adobe Flash IDE, mobile development for Google’s new Android 2.2 operating system (code-named Froyo) couldn’t be easier.
In this article, I discuss the essential tools you need to start developing for AIR for Android using Adobe Flash Professional CS5. I walk you through getting AIR installed on your Android phone and configuring Flash software to develop for that platform. Then I show you how to build and deploy your first application. While this application won’t be groundbreaking, it can serve as a solid launching point for your new future as a mobile applications developer. (Note: The details of this tutorial were tested against the AIR for Android release as of August 1, 2010, on a Google/HTC Nexus One running Android 2.2.)
Setting up your development environment
Getting set up to develop Android applications with Flash is pretty straightforward. Here is a list of the items you will need and where to find them:
- Google Android SDK: The SDK contains the tools you need to develop for Android regardless of whether you are doing native applications in Java or AIR for Android applications in Flash. Specifically, you will use two tools in the SDK during this tutorial: adb and ddms.
- AIR for Android: Currently AIR for Android is available through the Adobe prerelease program at no cost, but it does require you to sign up. Once you sign up, you will have access to the downloads of the AIR for Android installation file and the Flash Professional CS5 extension as well as the accompanying documentation.
Now that you have downloaded the tools, you just need to run through some steps to do the installations. Lee Brimelow covers many of these same steps in a video tutorial on GoToAndLearn. (Note: Most of the time, the instructions are the same, but Brimelow’s instructions assume you are working on a PC while mine assume you are working on a Mac.)
To get started:
- Unzip the Android SDK. You will need to access many of the items in the Tools folder of the SDK files via the command line, so it’s a good idea to keep this folder easily accessible.
- With your phone connected to your computer, use the adb tool inside the Tools folder to ensure that the phone is connected. (Note: You may need to install a driver for your phone if it is connected to a PC.)
- Open a command line window and navigate to the Tools folder inside your unzipped Android SDK, and run the command ./adb devices at the prompt. You should see your device on the list (see Figure 1). If you do not see your phone listed, make sure that it has the USB Debugging option enabled. This caused me some initial trouble. You can access this setting on Android 2.2 via Settings > Applications > Development > USB Debugging.
Figure 1. Use adb to ensure your mobile device is connected to your computer.
Now that you have confirmed your phone is connected properly, it’s time to install AIR for Android:
- Take the AIR runtime file you downloaded from prerelease and place it in the Tools directory under your Android SDK. (This isn’t required, but it makes it easier to find.)
- Type the following command at the prompt: /adb install Runtime_Device_Froyo_20100720.apk (Note: The exact filename of the apk may change depending on the date of the most updated release.)
You should see a response similar to Figure 2 indicating the install succeeded.
Figure 2. This response confirms you have installed AIR successfully.
You can also verify on your Android phone by navigating to Settings > Applications > Manage Applications, where you should now see Adobe AIR listed (see Figure 3). You can take screen shots of your application as well as other debugging information using the ddms application in your Android SDK tools directory.
Figure 3. Verify AIR is running on your Android phone.
Building mobile applications in Flash Professional CS5
To get started on a project, you first need to install the AIR for Android extension for Flash Professional CS5. Just double-click the install file to open your extension manager and install the extension. Once you have the extension installed, you should see an option for creating a new AIR for Android application under Create From Template when you start up the Flash CS5 IDE. Choose this option, which targets a document size of 480 × 800 and gives you an AIR for Android Settings button within your application’s Properties panel.
(Note: You can use Flash Builder instead of Flash Professional CS5 to create your mobile application. I recommend the series of tutorials by Terrence Ryan for more information.)
In Figure 3, you may also notice an application called KidsStorybook. That is the sample application you are building. It’s a very basic application consisting of five frames that contain the text from a storybook my seven-year-old son made for his class at school. (I was inspired by the much more interesting applications based on a child’s drawing that David Stockton built with Flash Catalyst.) You will notice from the screen shot that it looks like a native application on Android.
The application consists of very little code other than what is required to make the buttons browse through pages. Figure 4 shows one of the pages with both buttons as it appears on my phone.
Figure 4. The KidsStorybook mobile application.
Let’s take a quick look at the code that we’ll start with, which all exists in the first frame of a layer for actions. All this code does is add listeners to the button clicks and navigate to the previous or next page. I also added a listener to hide the appropriate button when a previous or next frame does not exist. As I mentioned, this is pretty standard (and basic) ActionScript code — nothing here would work any differently if you were simply targeting a browser.
In this code, I am actually using MouseEvent and not TouchEvent events. MouseEvent events work just fine on Android when pressed with your finger. In fact, the documentation recommends that you use MouseEvent events rather than TouchEvent events because they consume less memory.
Now if I were to deploy this application to my Nexus One or any other Android based phone that supports AIR, it would look and work just as I’d expect. That’s what’s great for Flash and ActionScript 3 programmers — you can leverage the knowledge and skills you already have and create mobile applications easily. However, nothing in this sample application takes advantage of the mobile platform. Let’s change that by quickly adding some code to leverage the touch screen by enabling users to swipe left or right to change pages.
That is all you need to do. I simply added a listener for the swipe gesture and called a swipeHandler() method. This method looks at the value of the offsetX property of the event to determine if users are swiping from right to left (that is, going to next page) or left to right (that is, going to the previous page). I told you this stuff was easier than you thought.
Deploying your first application
At this point, you’ve built the application, but you haven’t actually tested it on your phone. Let’s walk through how to manage the settings for publishing within Flash Professional CS5 using the AIR for Android extension.
In the Properties panel for your Flash application, click the Edit button next to the AIR for Android settings. This should open a new window with several tabs, including General, Deployment, and Icons.
In the General tab, you can do things like set the name of your application, the version, and the aspect ratio. These should all be pretty self-explanatory.
The Deployment tab (see Figure 5) contains settings for your certificate, which is required. For this example, I am using a self-signed certificate. You also use the Deployment tab to specify whether to create a debugging or release build. Finally, the Deployment tab enables you to automatically install and launch the application on a connected phone for testing. Simply point to the copy of adb in your Android SDK Tools directory (that’s the tool you used to test that the device was connected earlier in this tutorial). Assuming your phone is still connected, click Publish. The AIR application should now install and launch on your mobile phone, which you can see by either browsing on your phone or using ddms to take a screen shot.
Figure 5. Use the Deployment tab to publish your application.
If you run this application, then you should be able to browse the short book my son wrote using either the buttons or the swipe gesture. However, the application has a generic icon when listed among the other applications on the phone. To fix this, simply add your icon to the Icons tab. I simply made a 72 × 72 PNG image of the fish and added it to the settings.
Now you’re a mobile developer
You are now officially a mobile developer. You can even build those sexy native applications everyone seems to want. Granted, your first application wasn’t groundbreaking, but it was a good start. While we touched on using gestures, you can take advantage of so much more with the touch screen and accelerometer to create better and more exciting applications.
For more information, visit the Mobile and Devices Developer Center. If you’re interested in delivering video to mobile devices, make sure to see Edmond Au’s article. If you’d like to see inspiring examples of Flash content running on devices that support Flash Player 10.1, visit the Adobe Flash Showcase for mobile.
Brian Rinaldi is as a Content and Community Manager for the Adobe Developer Center team, where he helps drive content strategy for HTML5 and JavaScript developer content. Brian blogs regularly at http://remotesynthesis.com and is a unreformed twitter addict @remotesynth.
Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.
Источник
Adobe Air APK for Android
A free cross-platform app development tool
Adobe AIR is a free app development software program that gives users the tools needed to create cross-platform 2D and 3D games. The application features accelerated rendering, advanced bitmap support, texture compressions, and more. With its help, you can quickly create a large number of applications and widgets. Adobe AIR isn’t limited to Android, though. It is also available for download on Windows devices.
What is Adobe AIR and why do I need it?
Adobe AIR is a cross-platform application development tool that enables developers and designers to create stunning gaming apps and widgets for various operating systems.
The program is suitable for creating prototypes before developing full-fledged programs. Additionally, you can integrate the app with other software programs to deliver apps quickly and effectively.
How can I create 3D games using Adobe AIR?
Adobe AIR download gives users a range of APIs, including LZMA compressions that to create high-performing applications. Apart from this, the program offers accelerated GPU rendering, taking advantage of the power of DirectX graphics and OpenGL. All of these features help developers to create 2D and 3D games that are not only visually appealing but super fast!
Additionally, when you get Adobe AIR, you have access to various codecs such as MPR, AAC, and H.264, so you can play high-quality videos. The program uses various GPU chipsets and hardware optimization tools to help scale videos according to the running platform.
Does Adobe AIR support bitmap?
Adobe AIR download for Android offers advanced bitmap support for smooth and interactive animations. The program comes with bitmap caching and decoding, so you can create high-resolution images or change the pixels of already imported bitmaps. On top of this, the feature lets you easily add effects and textures to images.
Offers HTML and Flash integration
When you download Adobe AIR on your Android device, you get access to the in-built ActionScript and JavaScript environment. These two support cross-platform innovation via event handling, as well as parameter checking among various languages. Users can also use the same rendering technique to display and HTML content.
Can you extend Adobe AIR?
Yes. You can easily integrate it with other software.
AIR gives users the option to call platform-specific or native code using the extensions available on the platform. Once downloaded, the program gives you access to multiple, free libraries that are available as part of Adobe’s game developer utility tools.
What are the benefits and drawbacks of using Adobe AIR?
First published in 2007 under the name of Apollo, Adobe AIR offers various tools that make cross-platform application development a possibility. The primary benefit of using this app is that it lets developers use their skills, as well as coding knowledge to develop feature-rich apps that work on browsers, desktops, and handheld devices.
While there aren’t many drawbacks to using Adobe AIR, there is one that stands out. Developing apps via Adobe AIR can overload your system, even when you’re creating simple applications. Also, because the program has many features, it may seem a little complicated to beginners or developers new to the software.
How much does the Adobe AIR download cost?
You can download Adobe AIR on your Android device for free. The application doesn’t require any additional applications or tools, and you can use a simple text editor to develop and deploy AIR applications.
Are there any alternatives?
Adobe AIR offers a range of features for developing cross-platform 2D and 3D games. Squarespace Start is a similar app that lets users create websites directly from their phones. Other applications that you can check out include Java Programming for Android and Flash Player.
Should I download Adobe AIR?
If you’re a developer inclined towards creating games for multiple platforms, you could stand to benefit from downloading Adobe AIR.
The free Android program offers many features that let users create stunning and fast 3D and 2D games that work well on a variety of platforms and operating systems. With support for bitmaps and extensions, the comprehensive tool is ideal for creating quick prototypes and developing apps during hackathons.
Источник