Android - V10 release candidate

Previous topic - Next topic

Kitty Hello

Hi,

http://www.glbasic.com/beta/glbasic_sdk.exe

This version is the current release candidate of V10. This version can also gain live-updates.

For Android develpment you need to:
-Install a Java JDK, 32 bit
-install the GLBasic beta setup but to GLBasic_beta - Don't install to GLBasic(beta) - braces will make things bad
-Make a project of your choice and move to a path with no spaces
-Set platform options for Android
-Plug the device in
-Make sure the drivers are installed. (might need to install the Android SDK for that?)
-Build for android -> it will copy the Media to the temp project directory and install it on your device.

Feedback appreciate. Warning - this is a release candidate - no stable release, yet.



Dabz

#1
Kitty Hello... I love you! MWAH XXXX

;)

Dabz

EDIT: Before you attempt to build, make sure you set your Java JDK path in your environment variables or you'll receive this error:-

*** Error: Environment variable JAVA_HOME must be set to JDK path
Please install the Java Development Kit and set the variable.
Example: C:\Program Files (x86)\Java\jdk1.6.xx

If you have the IDE open at the same time as adding the above, you'll need to restart the IDE to catch the path or you'll end up getting the same error.

Dabz

Right... I just ran Nags Heed Darts on me phone (HTC Desire)... It ran though, here's what I'm getting

- no music (Music is mp3)
- sound is fine
- file system stuff seems to work
- mouse commands seem to be grafting

Though, my original code base is based on 320x480 for iOS, now, when I add this to project settings to match the original, and load it onto my phone, it doesnt scale to suit the whole of the devices screen... I used a library once called libgdx which is an Android based one, and basically, when I was using it, I just emphasised 320x480 in the init code and the engine scretched to suit... 

Is there any you could implement such a scaling feature behind the scenes Gernot, which obviously doesnt just scale the screen, but also handles touch events too?

This would be a bit of a boon IMO, because if I have to convert this manually, as well as Logic Battleships, I'll be suicidal :D

Dabz

MrTAToad

#3
Slight problem with extended types when compiling for Android :

C:\Users\Nicholas\AppData\Local\Temp\glbasic\gpc_tempg.cpp: In member function 'DGNat __GLBASIC__::TGui::LoadData(__GLBASIC__::TGrid&)':
C:\Users\Nicholas\AppData\Local\Temp\glbasic\gpc_tempg.cpp:1132: error: exception handling disabled, use -fexceptions to enable

Where do you get the swt.jar file from ?  Its not in the Android SDK - do you have to install it from the Eclipse setup ?

Keeps coming up with :

QuoteWARNING: Java not found in your path.
Checking if it's installed in C:\Program Files\Java instead (64-bit).

Java was found at C:\Program Files\Java\jre6\bin\java.exe.
Please consider adding it to your path:
- Under Windows XP, open Control Panel / System / Advanced / Environment Variables
- Under Windows Vista or Windows 7, open Control Panel / System / Advanced System Settings / Environment Variables
At the end of the "Path" entry in "User variables", add the following:
  ;C:\Program Files\Java\jre6\bin\java.exe

'"java.exe"' is not recognized as an internal or external command,
operable program or batch file.

However, it is in both the local and system PATH settings  (and I can run java.exe directly from the command line) :
QuoteC:\Program Files (x86)\Java\jdk1.6.0_25\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\MinGW\bin

I restart GLBasic after each change.  Windows 7 x64...

doimus

Can this be installed alongside regular, non-beta GLB?

Dabz

Quote
Can this be installed alongside regular, non-beta GLB?

Yeah, when it asks where you want to install it, remove the brackets in the file path and setup so it looks like C:\Program Files\GLBasic_beta, install as usual and you'll have a shadow copy running alongside your proper install.

Quote
However, it is in both the local and system PATH settings  (and I can run java.exe directly from the command line) :

Make sure you create a new env variable, mine is:-

JAVA_HOME  :   C:\Program Files\Java\jdk1.6.0_22

Dabz


MrTAToad

#6
Yes, I think JAVA_HOME had the wrong value.

However, I now get this :

BUILD FAILED
C:\Program Files (x86)\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:310: null returned: 1

Where did you get your SWT file, by the way ?

Dabz

Quote
Where did you get your SWT file, by the way ?

Dunno Mr T, The only thing I've added was the JAVA_HOME thing, and it all worked... I have had my computer setup for Android development for ages mind... I'll have a peek and see if I can track it down!

Dabz

Dabz

Right, I've found it in here:-

C:\android-sdk-windows\tools\lib\x86

Its also located in here:-

C:\android-sdk-windows\tools\lib\x86_64

I'm on XP SP3, though, I dont know if you can remember the shenanigans with Vista and the minGW compiler path thingy me bob when you wanted to build modules in BlitzMax, maybe, just maybe, this is the same problem, or related!?!

Dabz

MrTAToad

#9
Yes, that looks like the one  - well found!

Hmm : "ERROR: SWT folder 'C:\Program Files (x86)\Android\android-sdk\tools\lib\x86_64' does not exist."  - wonder if it doesn't like spaces :)

Yes, doesn't like spaces.  However, still wont compile :

Quote*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:47ccc3f7 - 3D, NET
Wordcount:89 commands
compile+link:
BUILDSRIPT
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...

BUILD FAILED
C:\Program Files (x86)\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:310: null returned: 1

Total time: 1 second
Android=C:\Users\Nicholas\Documents\GLBasic\Utilities\Plasma\android
success


Dabz

#10
Quote
Yes, that looks like the one  - well found!

lol, dont thank me, thank XP's little doggy search thingy! :D

Quote
BUILD FAILED
C:\Program Files (x86)\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:310: null returned: 1

Right, I've had a look and it seems that the problem here is that you need to configure the Android SDK, I havent a clue what mind, lol, but, what I've done to my SDK in the past is installing the newest components from Google,  setup an emulator, as well as installing the USB connection driver whatsit... Which, I think, is what the problem is...

I setup my SDK through Eclipse, so, my guess is your best going to the Android site, go to the SDK installation instructions and follow them till you get to the point where you can create a AVD, as well as making sure while setting up you install the USB driver.

Dabz


MrTAToad

So, install everything they've got, eh ? :)

Dabz

Quote
So, install everything they've got, eh ?

Wont hurt! ;) Hehehe

Dabz

MrTAToad

#13
Busy installing now :)

No, still fails :(

Dabz

Quote
No, still fails

Bugger!

Basically, what you've done is what I've done, I literally have done nothing different that springs to mind, but, going off Google, it does look like its something to do with the SDK, but the answer isnt on there!?!

So, last thing I can think of is that by any chance could someone try this on Windows 7 32bit (Or Windows 7 64bit) to see what results they get... As I'm running XPSP3 and all seems well!

Dabz