This tutorial is outdated. Trying to build an Android .apk by following these instructions is most likely not going to be successful anymore. The dependencies have received many updates and may function differently. Also, the download links might be rotten (Wikipedia) by now. I don't recommend trying to follow these instructions anymore, as you'll most likely just waste your time. I also take no responsibility of any issues that may result from following this tutorial's instructions.
Original post below.
In 2011 I wrote:Hello everyone,
I just got my first Android test running and I am now going to teach
you how it happens, be careful and follow the steps exactly.
Remember that the current version of geandroid is still unfinished and that the port is not ready and not optimized, so no one should actually use this for trying to make an actual game for Google Play store, but instead just for testing their game on their phone, which is still quite enjoyable :D
THIS TUTORIAL IS FOR WINDOWS, I don't know how it works on other platforms.
Steps 1 - 5 have to be done only on the first time building an .apk. Later on you can start from the step 6.
1) Download and extract GE Android, which you'll find here:
- Code: Select all
http://www.mediafire.com/download/n2tyrtw999hy1o5/geandroid.zip
(Note that you have to be signed in to the game-editor.net for having the access to the file!)
2) Download and install Android SDK, you'll find it here:
- Code: Select all
http://developer.android.com/sdk/index.html
Choose the one that's recommended. If it tells you to get Java SE Development Kit (JDK), get it.
Don't install it to Program Files (x86), because windows will not let it download what it has to download.
3) Download Apache Ant from here:
- Code: Select all
http://www.softpedia.com/get/Programming/Other-Programming-Files/Apache-Ant.shtml
Extract the file.
4) Write a similar bat -file in Notepad or some other program:
(EDIT: If you have downloaded geandroid after 1.5.2014, your geandroid folder will already have a setup.bat -file. You can either modify it, or delete it and create a new one. You can't use the old one without modifying it, because it's configured for my computer.)
- Code: Select all
set ANT_HOME=c:\apache-ant-1.8.2
set CLASSPATH=C:\jdk1.7.0_01\lib
set JAVA_HOME=c:\jdk1.7.0_01
set PATH=%path%;%ANT_HOME%\bin
set PATH=%path%;c:\android-sdk\tools
So, set ANT_HOME to be the path to the folder named exactly apache-ant-1.8.2. So, if you got a folder named apache-ant-1.8.2-bin, that's not the right one, in that folder there is a subfolder, which has the right name, be careful!
And for the CLASSPATH, you'll have to search where it has installed your JDK, and the lib-folder. It's most likely in C:\Program Files\Java\jdk1.7.0_02\lib
JAVA_HOME is the folder where you can find the lib-folder, so most likely: C:\Program FIles\Java\jdk1.7.0_02
The next line you can leave as it is.
And the last line, replace the c:\android-sdk\tools with your android-sdk tools folders location.
Save the file with the name setup.bat and in your geandroid -folder.
5) Open SDK manager.exe. (You can find it from the folder where you have installed the Android SDK.) Now select the selection box for 'Tools' and click 'Install packages'.
Then select some of the Androids (I selected 2.3.3, because that's what akr mentioned in game-editor.net), and click 'Install packages'.
6) Now copy your GE file (exported as .dat) and place it to geandroid\assets
Your file has to be named as geplayer.dat! (This may change to game-editor.dat!)
7) Search Command Prompt from your computer, it can be in: Start menu -> All Programs -> Accessories -> Command Prompt
(You can also just type "cmd" (without quotes) to the windows start menu search box and press enter, or press Windows key+R to open the "Run" dialog, and then write "cmd" (without quotes) there and press enter.)
Open it and type:
- Code: Select all
cd C:\Downloads\geandroid
Replace the location with the location of your geandroid folder!
And press enter.
8) Now type:
- Code: Select all
setup.bat
And press enter.
9) Now type:
- Code: Select all
android update project -t 1 -p .
And press enter.
Write exactly as above, even a little mistake, and it gives you an error!
10) Now type:
- Code: Select all
ant debug
And press enter.
It takes few seconds and then it should show the following text:
BUILD SUCCESSFUL
11) Now go to your geandroid -folder -> bin and there you should see a list of files named as: GEActivity... Search the one named as GEActivity-debug.apk and copy that to your phone.
12) Search the file from your phone (for that I suggest Astro File Manager. Just search Astro from the Android market), install it and...
ENJOY! :D
I hope this tutorial is good and tells you what to do accurately enough.
If you need help, just ask, and me or someone else will help you!
At last I want to say..
It may be demanding, but it's really rewarding too! :)
CUSTOMIZING YOUR APK: (NEW!)
With the help of ayushpal I have found some neat ways of customizing the app's properties.
Changing the application's name:
Go to geandroid -> res -> values and open the strings.xml with Notepad. You'll see this:
- Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ge</string>
</resources>
Replace 'ge' with the name of your app.
Changing the application's orientation
Go to geandroid-folder and open the AndroidManifest.xml with Notepad. With a little searching you will find this:
- Code: Select all
android:screenOrientation="landscape"
Replace 'landscape' with 'portrait' in order to change the orientation.
Changing the application's icon
Go to geandroid -> res. There you will see six folders, three of which being:
drawable-hdpi
drawable-ldpi
drawable-mdpi.
In every folder there is a file named 'icon.png', replace it with your icon file.
The icon in the hdpi folder has to be 72 x 72 pixels, the ldpi one has to be 48 x 48, and the mdpi one has to be 36 x 36.
Go to geandroid -> bin -> res, and repeat the same actions.