Viewers: in countries Watching now:
In Flash Professional CS5: Creating a Simple Game for Android Devices, author Paul Trani shows how to translate existing Flash skills from the web to mobile devices while designing a game in Flash and publishing it as an AIR for Android app. The finished application includes collision detection, random enemy creation and movement, shooting capabilities, multiple levels, and even a high score screen. This course also goes beyond game functionality and shows how to use mobile capabilities such as the accelerometer and gestures to control graphics, use the hardware keys to activate menus, and also how to optimize content so it plays well on mobile devices. Also included are instructions for distributing an app through the Android Market. Exercise files are included with the course.
Now that I have an APK file created, what I want to do with this file, which is really my game, is I want to go ahead and put it on my Droid device. So, I happen to have a Motorola Droid 2 that I want to put this APK file on, but there is one thing I need to do on my Droid device first. So here's my Motorola Droid 2. I am going to go ahead and hit that Options button down in the lower-left, and I am going to go into the Settings. Now, some of these buttons might not be exactly the same depending on your Droid device, but it will be in Settings, and if you go into Applications, there should be Development.
So, select Development to set Development options. And right within this list, notice it says USB debugging. So, debug mode when USB is connected, go ahead and check that. You can also allow for mock locations if you are doing any location-based gaming or anything like that, but again, that's the only box you need to check. And when you're done with that, you can just go ahead and hit on that Home button, and now the device is ready and good to go.
So, from here, I can go ahead and connect this device to the computer through a USB cable. Now, with my device connected by USB, what I want to do is I want to transfer this APK file to the device. But what I need to do in order to do that is I need to go ahead and get the SDK from Android, the Android SDK. If you go to developer.android.com, it's that second tab right here, so select SDK, and then right in here, if you're on the Mac or Windows, you just select the appropriate one.
I am going to go ahead and download this Android-sdk release 8. It will download it. Now, I can go ahead and double-click on that file, and notice here are all of the assets that I had just downloaded. So, I am going to go ahead and take this entire folder and I am going to just put it on my Desktop. I am going to make it easy to get to. So, I will take this entire folder and put it right on my desktop, close that, and I'm going to rename this because I just want to reference it as AndroidSDK, just like that. All right.
Now, if you recall, all of my files are in here, but really all I need is this Invaders.apk. So, again, I want to package that up. I am going to use this AndroidSDK to do that. I am going to go into tools, and the first thing you are going to need to do is launch this android SDK right here. This is an executable. Click Open. It will launch. And you need to go to Available packages. And if you check the Android Repository, it will go ahead and install all of these items.
So, that's exactly what I want to do. I want to install everything. I am really only going to use one file out of here, but let's just go ahead and install all of these items. It might say there might be some dependencies. Either way, I am just going to select Accept All and then install everything. Everything is installed. It says, well, do you want to restart ADB now? I will say sure and restart it. Ten packages are installed.
I will go ahead and click Close. Its going to do quite a few things, by the way, but really what I want to do is I want to go ahead and take a look at one tool in particular that I have downloaded, because it did install all of these various folders right in here. But again, I am going to go ahead and open this folder, and within platform-tools, you'll find this ADB file. This is the Android Debug Bridge. So, that's actually what I am going to use to take this APK and install on my device.
But to make this even easier on me, I am going to go ahead and take this APK and drag it right into this folder here. All right. Okay, so let's set this up. Again, I am just going to use this APK file and that adb tool right there. So, I am going to go ahead and use my search tool to search for the terminal and launch it. Here's my new terminal window. I will just do Command+Plus to increase that font size, and now I can go ahead and install.
This file is using the adb executable. But what I need to do is I actually need to target the directory that they're in. So, I am going to say cd for current directory, there on the Desktop, forward slash. They are inside that Android SDK folder, SDK/platform-tools, just like that. So, I am targeting that folder. I will hit Enter. Now, with that folder targeted, I can go ahead and use that adb, that Android Debug Bridge to install the Invaders.apk file.
Just like that, I will hit Enter. It goes through and installs it. As you can see, success, and it tells me exactly where it installs it. So, works out great. Now I can go ahead and check it out on the device. Here's my Motorola Droid 2. I am going to go ahead and go where all my applications are, and I'm going to scroll to where that Doodle Galaxy Invaders app is. As you can see, it does have the icon. You can see it right there.
Again, there's no transparency on it, but again, I can just go ahead and select it and the game will start. Here's the intro screen. I'll go ahead and select Play to play the game. (explosions) So, I am able to tilt the device and play the game, and depending on how well I do will determine what I get for the high score screen.
Whether I enter in my name or maybe-- especially if it's my first time, I get the opportunity to inter in my name. And if I do select that input text field, I can go ahead and type in my name. It actually activates the keyboard. I can type in my name, click Done, click Enter. It says, "Great job." Now, I will go ahead and play again. So, I can play the game again, but you can see that it's working, and I was able to publish out to the device pretty easily.
There are currently no FAQs about Flash Professional CS5: Creating a Simple Game for Android Devices.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.