GLBasic forum

Main forum => GLBasic - en => Topic started by: tagoror on 2011-Aug-18

Title: How to build Android application package (.apk)?
Post by: tagoror on 2011-Aug-18
Hello,

Today i started to play with a Android devide, i installed the SDK and i build a test with GLBasic for Android, but still i don't know how build an application package (.apk file) to can install the application on the device.

Can GLBasic create the .apk file? or how i can build it?

Regards,

Javier
Title: Re: How to build Android application package (.apk)?
Post by: Minion on 2011-Aug-18
If you have your Android phone plugged in, when you compile you application GLBasic will transfer it over to the device automagically.
Title: Re: How to build Android application package (.apk)?
Post by: Slydog on 2011-Aug-18
Also I assume you must use the 'Compiler' -> 'Build Multiplatform' menu item.  Then choose 'Android'.
(I don't have an Android so I've never really done this yet)
Title: Re: How to build Android application package (.apk)?
Post by: msx on 2011-Oct-01
Every time I try to build for android, get the following errors:

Quote_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.074 SN:eb639bf3 - 3D, NET
Wordcount:814 commands
compile+link:
BUILDSRIPT

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:472: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:203: apply returned: 1

Total time: 13 seconds

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:472: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:203: apply returned: 1

Total time: 8 seconds
Android=C:\Documents and Settings\Propietario\Mis documentos\GLBASIC\GLBasic\Resultados Futbol\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 52.0 sec. Time: 16:40
Build: 1 succeeded.


And I don't find the apk file. Can anyone help me?  :'(
Title: Re: How to build Android application package (.apk)?
Post by: MrTAToad on 2011-Oct-01
If the first stage fails, then you wont get an APK (it doesn't matter if the second stage fails).

The most common cause of failure is invalid characters in the program or company name - spaces aren't allowed and various other characters.
You also need to install the Java SDK and correctly setup all the paths.

If you can make the project available we can see if the cause is local to your system or not.
Title: Re: How to build Android application package (.apk)?
Post by: mentalthink on 2011-Oct-01
Are you put your android device in developer mode, for me if I not put his option verified, I don´t inject the code in my Archos.
Title: Re: How to build Android application package (.apk)?
Post by: msx on 2011-Oct-01
Quote from: mentalthink on 2011-Oct-01
Are you put your android device in developer mode, for me if I not put his option verified, I don´t inject the code in my Archos.

I have not a android device, I want to try it on the emulator but I need the apk file.

Quote from: MrTAToadThe most common cause of failure is invalid characters in the program or company name - spaces aren't allowed and various other characters.
You also need to install the Java SDK and correctly setup all the paths.

I Have installed the JDK and II have included the environment variable JAVA_HOME. On the other hand, I suppose you mean about name of the company is in Project-> Options, right?.
Title: Re: How to build Android application package (.apk)?
Post by: MrTAToad on 2011-Oct-01
Thats right
Title: Re: How to build Android application package (.apk)?
Post by: msx on 2011-Oct-01
Is it necessary to have an android device connected?
Title: Re: How to build Android application package (.apk)?
Post by: spicypixel on 2011-Oct-01
Nope you don't need an Android device connected ;)
Title: Re: How to build Android application package (.apk)?
Post by: mentalthink on 2011-Oct-01
no Msx, if you have the emulator running before you start the compiling, autmatically the application goes to the emulator, but really it´s a grear "mierda" it´s really slow, slow.

Have another manner, but I don´t know how put into the the emulator de Applications, this mode it´s using Virtual Box, and installing Android like a another S.O, it´s very easy, but I don´t succes put the info into the "virtual-Phone", in this mode seems the emulator runs very quickly.
Title: Re: How to build Android application package (.apk)?
Post by: ampos on 2011-Oct-01
Yo me instale el SDK y no había manera. Así que lo desinstale, y toma ya, funcionó. El GLB tiene instalao el SDK y el emulador... qué cosas.
Title: Re: How to build Android application package (.apk)?
Post by: msx on 2011-Oct-01
¿El SDK de Android?, ¿no hace falta?  :blink:
Title: Re: How to build Android application package (.apk)?
Post by: ampos on 2011-Oct-01
Sí hace falta, pero es que el GLB ya lo trae instalao.

Yo por ejemplo, cuando lo instalé y lanzaba el emulador a mano, al dale a "run", no salía nada. Pero después de quitarlo y buscar el emulador en el GLB /compiler/.../android y lanzarlo a mano, sí que me salía un Android. Eso sí, lento como el culo.
Title: Re: How to build Android application package (.apk)?
Post by: sf-in-sf on 2012-Apr-14
Quote from: mentalthink on 2011-Oct-01
......... if you have the emulator running before you start the compiling, autmatically the application goes to the emulator, but really it´s a grear "mierda" it´s really slow, slow.

I found acceptable speeds for os 2.3 and 3.0 only when you set the resolution to 320x480. In the AVD, just edit the os version before running it, and adjust the resolution. It makes a big difference.