Help Android Export

Previous topic - Next topic


I tried to compile my code to Android, but it returns this error:

Code (glbasic) Select

running Android build-script...
BUILD STAGE 1: Compile and pack RELEASE
Exception in thread "main" java.lang.RuntimeException: Failed to create Q:\Compiler\platform\android\android-sdk-windows\add-ons.
Buildfile: build.xml does not exist!
Build failed
BUILD STAGE 2: Build DEBUG and install on device
Buildfile: build.xml does not exist!
Build failed
finished Android build-script.

I installed the 32 bit version of Java JDK: jdk-7u5-windows-i586.
I created the environment variable: JAVA_HOME.
I installed the Android SDK, but I do not know what should I download on the SDK Manager.
I downloaded the Android SDK Manager: all API version 4.1 and version 2.3.3 and USB Driver Google.
I created the add_ons folder and now there is a path: C: \ Program Files (x86) \ GLBasic \ Compiler \ platform \ Android \ android-sdk-windows \ add_ons
I tried deleting the folder Android, contained in the folder distribute 
and after I went to File -> Project -> Clean Up, and then I redid the Build Multiplatform, but the error remains.

I use Windows 7 Ultimate 64 Bit.
What is wrong?
I do not understand why the compiler searches the drive Q.

Sorry for my bad English.
Thank you for help.  :good:


Did you create add_ons or add-ons ?  One will work, and the other wont!


Ohhhhhhhhh Yessssssssss you're right  :booze:

Now I copied the file created: glbasic-debug.apk

in the micro sd, and I installed the APP but appears not to work ...

Can you tell me how you start the Android emulator?

thank you!  :good:


With the Android emulator you need to activate "allow third-party applications", and then :

Start the console ("Start -> Run... -> type 'cmd'" for Windows computers). Type-in the following command: adb install $APK where $APK is the name of the APK file. For example: adb install Snake.apk

It will only install if there is enough space.

Once done, when you go into the main menu the application should be there.


thanks for the explanation.  :good:

One question: why the first time if I launch the app there is a long time to run?


The first time your GLB app runs, all of the media files are copied out from the apk package - this takes a long while, but then afterwards your apps should start quite quickly.
A loading symbol or splash screen while the media files are copied *might* be implemented eventually (I'm not to sure on where this has gotten, but it isn't that much of a problem)
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary


Thanks for the reply.  :booze:

The only problem is that the startup time of the APP the first time is slow, then the screen goes into auto lock.

If you touch the screen as it boots, the message asking to kill the APP.

Other questions:
- No way to use the bluethoot on Android?
- My game is in 480x320 mode (works fine on Samsung Galaxy Ace) there is a quick way to change resolution for other devices (Samsung S2 Galaxy: 800 x 480 - Samsung S3 Galaxy 1280x720, etc.), with the resize of the sprite to maintain the correct position on the screen.


The startup time isn't great, but you *might* be able to display a splash screen or prevent autolock by modifying the java code, but I'm not sure if anyone's succeeded yet.  Anyway it's not too bad that a native GUI is being developed first  =D

There's no way to use bluetooth with GLB commands, but using inline code and by modifying some of the java it should be possible - although I wouldn't know where to start...

On rescaling, I personally cheated and rendered everything to a 480x320 virtual screen (CREATESCREEN, USESCREEN, etc.), which I then rotate and display.  Code has been posted in the forums though - for instance
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary


I found the routine .
It works great.  :good:


I do not understand, on Huawei U8650 (600 mhz processor and 256 MB RAM) the game runs at 60 FPS, on Galaxy S3 runs between 30 and 40 FPS.  :S

Mystery ...

The auto lock of the screen  is a stress ..  :rant:

Unfortunately, the routine for resize of the sprite does not preserve aspect ratio when switching from a 480x320 to a 1280x720.

The sprite is warped on Y.


I have the same problem with my S3.
Check this post for details

I'm still trying to figure this out. Performance hit seems to come from the SHOWSCREEEN command.
Also, my game will run at 20 FPS for a few seconds, then 60 FPS for a few seconds, then back to 20 FPS.