Publishing to an Android device (PC)
Video: Publishing to an Android device (PC)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 happened 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'm 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.
- Next steps
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.
- Designing for mobile platforms
- Creating and optimizing game graphics
- Adding random movement and interactivity
- Moving players based on the accelerometer
- Using gestures
- Detecting collisions
- Implementing audio
- Adding scoring and levels
- Implementing a high score screen
- Publishing an app on both Mac and Windows
- Uploading to the Android Market
Publishing to an Android device (PC)
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 happened 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'm 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 do 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, we're really getting down to the fun part where we actually get to take our game and put it on an actual device and play with it. So again, here's my game right here. It's an APK file. And I want to take that and push it out to this Motorola Droid that I have connected via USB already, so it's already connected, and that's how I choose to push it out to the device and know that I can also take this APK and I can email it to the device, or I can put it on a URL and go to that URL on the device as well.
So there are many different ways, but I find connecting it through USB just makes development much faster. So really, what I need to make this happen is the AndroidSDK. So I'm going to go ahead and go to developer.android.com, and right there on the Home page you'll see Download, and this is where you'll download the SDK. I will click Learn More, and again, this is constantly being updated, but you can see right here in this main area, here's my Windows link for that SDK, and I can select it and download it.
It is a zip file, so again just download it, unzip it. I've actually already done that, so it's right here, so I'm going to click Cancel, and I'll just open up that folder. As you can see, these are all of the items that I've already downloaded, but before I get into that information, I would like to point out a couple resources on this page, because everything from the blog to the forums is really helpful, but know that since I'm connecting this device through USB, I need to make sure my USB drivers are up to date. So if yours aren't for some reason, you might consider going out here and just updating your drivers, okay.
My drivers are doing fine on this droid device, so I don't need to do that and you might not need to either. But nonetheless, just go ahead and download that SDK. Here it is. I'll open this up, and the first thing you would want to do is run this SDK manager. This is really going to install everything that you need. So I'll run this, and as you can see, I pretty much have everything already installed. So again your list may vary, but again, I have one item on my list that I can go ahead and install. But again, just make sure they're all checked and then select Accept All, just to install everything, just to make sure you have everything you need. Click Install. In this case, I'm fully up to date, so I can just click Close, and that could take up to 10 minutes, by the way, but notice it does install quite a few things and a lot of tools you might end up needing.
But again when it comes to just pushing out an APK to a device, I am really only need the Android Debug Bridge, so let's take a look at where is that at. Now that everything is installed, if I go back out here to this folder, notice that there's this Platform tools folder, and this gets installed when you run the SDK manager. So I'll open this up, and nonetheless here is the ADB, our Android Debug Bridge that I want to run. Now I'm going to use this to push out this APK to my device.
So I'm going to takes this APK and I'm just going to drag it into that same folder. Okay this is just going to make development a little quicker for me. I'll move this off to the side, and again I'm going to use this to package up this APK, and I'm going to do that through the command line. So I'm to go ahead and select the Start menu, and I'll just type CMD. There is my executable so I can hit Enter, select it, and here we are. So the first thing I need to do is I need to target that specific folder. So I'm going to say CD for Current Desktop and type in Desktop and point to that specific folder, so AndroidSDK. So whatever that folder is called, again, I have just renamed it and to make it a little shorter and easier to type, and I want to make sure that everything is capitalized appropriately. AndroidSDK/platform dash tools right in that folder.
I'll just do a forward slash, hit Enter, and now I'm targeting this folder. Now the next thing I need to do is I need to go ahead and use the ADB, so just type in ADB install and then Invaders.apk. Since it's in that same folder, this is really easy to type. I would say it's pretty darn straightforward, and that's all I need to do. So again, I'm going to make sure my device is connected by USB. I'm going to make sure my drivers are up to date, and if they are, all you need to do is hit Enter. It will go ahead and take that APK. Sure enough, success is what it says here, and it pushes it out to my device. And here's my Droid 2, so all I need to do is go to my Applications area, where all my applications are at. Notice how it says Doodle Galaxy Invaders.
I can go ahead and select that app to launch it. Here's the intro screen. I can go ahead and click Play to play the game. So using only really one of the features of the Android SDK, I can easily take any APK and push it out to a connected device.
There are currently no FAQs about Flash Professional CS5: Creating a Simple Game for Android Devices.