Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Compiling for Android Guide

Author
Message
Pieter11
12
Years of Service
User Offline
Joined: 7th Nov 2011
Location:
Posted: 7th Nov 2011 17:01
Hi all,

The player of Android is out and is working well on my 2.5 gingerbread HTC desire S.

I am wondering however is there a AppGameKit guide available to compile the app/game for Android since I saw Snake Snacker at the android market.

Example:
-compiling and packaging a .apk guide

If not when will there be a way to do this? I am starting development for Android games now but want a rough estimation when I can publish

Thanks in advance, all comments are welcome!
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 11th Nov 2011 23:58
Yes this will be included for the forthcoming 106 build and is currently been finalised and in the process of being tested. The T1 Android development is as painless as many of the other platforms, but the guide to set-up your own Android development system is quite lengthy. I can see why there are lots of frustrated Android developers out there. So many hoops!

I drink tea, and in my spare time I write software.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 12th Nov 2011 14:57
Seems like we will need a lengthy youtube video of how to set up the android dev system then!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Nov 2011 14:35
I've downloaded and installed the 106 build and I'm struggling to find the instructions for taking a T1 project and building it for Android?

Am I not seeing the forest for the trees or is the guide missing?

My signature is NOT a moderator plaything! Stop changing it!
jlahtinen
14
Years of Service
Recently Online
Joined: 26th Oct 2009
Location: Finland
Posted: 21st Nov 2011 16:20
To compile the tier 1 interpreter app open cygwin and browse to the android interpreter directory (cygwin is case sensitive and does not allow spaces in your project path), for example in my enironment that would be 'cd "/cygdrive/c/android/AGK/IDE/apps/interpreter_android" then try to compile the interpreter with the path to the NDK installation e.g. "/cygdrive/c/android/android-ndk-r6b/ndk-build 2> log.txt" errors will be put in log.txt in the interpreter_android folder. This compiles all the C++ code into the native library that will be the main part of the Android application.

I dont understand this. How I compile with Cygwin, some command or what?

Everything before this went fine, though I dont understand why Android-sdk has to be so complicated.
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 21st Nov 2011 18:01
Mobiius, it's in the help system, under "Guides"

my local AppGameKit installation path to the file:

C:\Program Files (x86)\The Game Creators\AGK\IDE\Help\guides\33_android.htm

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Nov 2011 19:36
Cheers, I'll check it out later.

My signature is NOT a moderator plaything! Stop changing it!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Nov 2011 23:41
Quote: "I dont understand this. How I compile with Cygwin, some command or what?"




is the command that compiles the code, you just type all of that out on the command line and hit enter (modified to point to your "android-ndk-r6" install directory of course).

In cygwin paths to items on your hard disk start with /cygdrive/ then follow the normal windows path but with forward slashes instead of back slashes. Also ndk doesn't like spaces in paths.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th Nov 2011 07:09
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 24th Nov 2011 07:35
Since r6b is hard to find, and r7 is not, you need the following command, if you installed r7:



----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 24th Nov 2011 10:22
how do you compile a Android game? I met many problems.

The Miracrea Games
jlahtinen
14
Years of Service
Recently Online
Joined: 26th Oct 2009
Location: Finland
Posted: 26th Nov 2011 00:30
Thanks Paul, but:

After typing: "/cygdrive/c/android/AGK/IDE/templates/template_android"

-bash: /cygdrive/c/android/AGK/IDE/templates/template_android: is a directory

And when I type: "/cygdrive/c/android/android-ndk-r7/build 2> log.txt"

Android SDK: Could not find application project directory !
Android SDK: Please define the NDK_PRJECT_PATH variable to point it.


Not right, i presume?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th Nov 2011 04:18
The first line is the browsing to the project directory so needs a "cd" in front of it like so "cd /cygdrive/c/android/AGK/IDE/templates/template_android"

The second line is a command and is correct, it just needs to be run from the right directory.
jlahtinen
14
Years of Service
Recently Online
Joined: 26th Oct 2009
Location: Finland
Posted: 26th Nov 2011 13:37
Ah, thanks a lot, got it now.

It's been too long since I've used any command prompt I see.
jlahtinen
14
Years of Service
Recently Online
Joined: 26th Oct 2009
Location: Finland
Posted: 26th Nov 2011 14:35
I've completed the AGK's guide, but I still have no idea how to compile my own tier 1 project into .apk.

Is it coming later in AGK's update?

Sorry for being noobish, it's DBPro's fault, it's so easy!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 28th Nov 2011 19:05
Once you are able to compile the existing code into an apk (which is saved in the "bin" folder), you can add you bytecode to it using the instructions on publishing which will make an apk containing your tier 1 bytecode.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 28th Nov 2011 22:38
hi, in tier 2 android how can resources (pics n sounds) be added to the project , i can`t seem to do it in eclipse .

also do they get compiled into the apk ?


thanks chunks.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 28th Nov 2011 23:37
Make a directory called ASSETS in your android_template project file (or whatever you named your project dir). Put all your sound and pics in there.

In Eclipse press F5 to refresh.

Your media will be bundled into the apk.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 29th Nov 2011 00:29 Edited at: 29th Nov 2011 00:35
Thank you i will try it now

EDIT:

Do you have to add the assets folder to the string when you load the pics eg (agk::LoadImage("assets/red.png")) or just eg (agk::LoadImage("red.png"))

thanks chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Nov 2011 01:04
Just agk::LoadImage("red.png")
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 29th Nov 2011 13:40 Edited at: 29th Nov 2011 13:58
hi i`m still having problems with adding resources , i have done whats been said above and it is still not adding the pics to the apk.

The apk runs fine on the emulator and my phone for everything else , i have also used the builder technique from a post above which builds without cygwin do you think it might have something to do with my problem or am i missing something .

thanks in advance chunks.

edit: Sussed it out , the assets folder created for resources needs to be named in lower case then it includes the resources.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 29th Nov 2011 14:08 Edited at: 29th Nov 2011 14:09
chunks, the android is case sensitive if you want to load "Image.png" and the file is named "image.png" it will not load!

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 29th Nov 2011 14:16
Always use lowercase filenames to avoid problems. ios and android are unix based and hence case sensitive
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 29th Nov 2011 14:19 Edited at: 29th Nov 2011 14:21
yep i found out the hard way lol , also it seems the folder for resources needs to be lower case eg: assets and not ASSETS and then resources get included .

thanks for the help .


Edit: I love the agk , once you have your head round the different compiling procedures its so easy and great thanks TGC .

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.

Login to post a reply

Server time is: 2024-05-04 08:00:21
Your offset time is: 2024-05-04 08:00:21