How this works?
What this tutorial will help you to do is to compile an Android executable (apk) with an embedded WebView control.
A WebView control is actually like a web browser inside your application. That means it can display all sorts of web content.
GameMaker HTML5 exports to web format so it's possible to package it this way in order to execute it as an Android app.
However, this application is not entirely native like the ones GameMaker Studio will export in the future so note the following downsides:
You cannot access the device's native features such as the accelerometer using GM:HTML5 alone (you might need a framework like PhoneGap which I may cover later)
Your game might suffer from performance issues on specific devices that have a low-end processor
Not all devices have an up-to-date WebView control, so some features might not work (I had problems with sound on some Android 2.1 devices)
Installing the Android SDK and Eclipse IDE
First, you need to download and install the Android SDK from the Adroid Developers website ( http://developer.and.../sdk/index.html )
Choose the package which says (Recommended) at the side of the link, download and install it.
Next up, you need to download the Eclipse IDE ( http://www.eclipse.org/downloads/ )
Choose the one that says "Eclipse IDE for Java Developers", download and install it as well.
Finally, there's one more thing to install, the ADT plugin for Eclipse ( http://developer.and...clipse-adt.html )
Follow the instructions provided in that page under "Downloading the ADT Plugin" in order to install it to the Eclipse IDE and after that restart Eclipse.
Configuring the Eclipse IDE
Open up the Eclipse IDE and you'll see a Welcome panel. You now need to provide your Android SDK install location. Choose the "Use existing SDKs" option and browse for folder to choose your SDK folder ( Usually it's "C:\Program Files\Android\android-sdk" ). Choose "Next" and then "Finish".
Next choose Window > Android SDK Manager and make sure you have downloaded the available API packages & USB drivers.
That's it! We're done installing the SDK and our IDE!
Creating a new Android project
Download and extract this zip file: download here
Now you're ready to start creating your Android project. Choose File > New > Project... and a panel will come up. You will notice under the folder list, there's one that says "Android", expand it and choose "Android Project". Next choose "Create project from existing source" and browse to the extracted project folder you downloaded previously.
At "Select Build Target" panel choose "Next". Next choose a custom application and package name for your application (it's good idea to keep the "com" naming convention for the package like com.mygamename) and click "Finish".
Testing your game
First you'll need to export your game from GameMaker:HTML5. Inside the html5game folder rename your game's js file as "game.js"
Navigate to your Android project folder and you'll find a folder called "assets". Place the "html5game" folder inside and keep the index.html file that's in there.
Connect your Android device through USB cable. On your device, go to "Settings > Applications > Development > USB Debugging" and make sure it's checked.
If Eclipse throws errors, then your PATH variable might need the Android SDK folder defined ( Check here at the section "How to update your PATH" http://developer.and...installing.html ), you haven't downloaded the Google drivers or your device might not be supported for USB debugging. If all goes well, your application will start and the game will load on your connected Android device!
Exporting an Android executable
First navigate to the application directory and in there you will see a folder called "res". Inside that there are 3 subfolders that all have PNG files in them. You will need to change those in order for your apk to use a custom application icon. Change the icon look but don't change their dimensions.
From the Eclipse IDE you will need to Run the game once on your device (Run > Run Ctrl+F11) then you will need to navigate inside your project folder, inside the "bin" subfolder and find an .apk file. This is what you need to distribute to other people so they can play your game on their device, however you cannot distribute this apk through the Android Market without a keystore file. Android development costs one time fee around $25 and you can start making an account here: https://market.andro.../publish/signup
Have fun and consider waiting for GameMaker Studio if you need best performance and functionality for your game!
Edited by alexandervrs, 10 April 2012 - 09:51 PM.