GLBasic forum

Main forum => GLBasic - en => Topic started by: Armoured on 2012-Jun-19

Title: Android and java 7
Post by: Armoured on 2012-Jun-19
Hi :)
GLbasic can compile android applications with Java 7 SDK?

Thanks.
Title: Re: Android and java 7
Post by: MrTAToad on 2012-Jun-20
No, it uses the NDK - and Java
Title: Re: Android and java 7
Post by: Armoured on 2012-Jun-20
Quote from: MrTAToad on 2012-Jun-20
No, it uses the NDK - and Java

Yes, but what version of Java?
Title: Re: Android and java 7
Post by: mentalthink on 2012-Jun-20
Welcome Armoures... for compile for Android donwload the JDK, donwload the lastest, but I think you need x32, if you have windows x64, donwload and install jdk x32... whit x64 perhaps you have troubles...
Title: Re: Android and java 7
Post by: Armoured on 2012-Jun-20
Ok!
I have the last version of GLBasic (10.283) with the 32 bit JDK 7 but when I try to compile, for example "Scramble.gbas", for Android I have these errors:

Code (glbasic) Select

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.9.829 SN:******* - 3D, NET
Wordcount:825 commands
compile+link:
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.
at com.android.sdklib.SdkManager.loadAddOns(SdkManager.java:665)
at com.android.sdklib.SdkManager.createManager(SdkManager.java:144)
at com.android.sdkmanager.Main.parseSdk(Main.java:221)
at com.android.sdkmanager.Main.run(Main.java:118)
at com.android.sdkmanager.Main.main(Main.java:102)
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.
Android=C:\Users\Marco\Documents\GLBasic\Samples\_Projects_\Scramble\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 6.2 sec. Time: 05:34
Build: 1 succeeded.


Why?
Title: Re: Android and java 7
Post by: mentalthink on 2012-Jun-20
Ok Armoured, now I don´t know exactly the error, but it´s always common this problems... Not it´s trouble of Glbasic, I´m sure...

I tell you what you can do...

In the Help (F1), goes to this part:
GLbasic intern, and after goes to Compiling for Andriod... follow the steps whit calm, and if you make all and don´t works, I or another people sure can resolve the trouble...

About you error, I´m not sure but you donwload the Android SDK?¿, b sure to put correctly the enviorement variables
PS: Making the Help says have to works
Title: Re: Android and java 7
Post by: MrTAToad on 2012-Jun-20
For that error message, create a directory in <program files> \platform\android\android-sdk-windows\add-ons

I think it uses V6 or so of Java for some bits/
Title: Re: Android and java 7
Post by: Armoured on 2012-Jun-20
Now it works!  :good:
I follow these two steps:

1)  I have created a key for the debugger with this command in the cmd window.
Code (glbasic) Select

C:\Users\YourUserName\.android>"c:\Program Files\Java\jdk1.7.0_03\bin\keytool.exe" -genkey -keypass android -keystore debug.keystore -alias androiddebugkey -storepass android -validity 1000 -dname "CN=Android Debug,O=Android,C=US"


2) I have created a folder named "add-ons" in "C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\"

Thanks MrTAToad and mentalthink.  :booze:
Title: Re: Android and java 7
Post by: mentalthink on 2012-Jun-20
Thanks to you Armoured, and enjoy the forum, you will find a lot of info about android and another platforms...

Again Welcome, and any question I´m sure anyone in the forum be glad to help you.
Title: Re: Android and java 7
Post by: Jonás Perusquía on 2013-Mar-27
old topic but still important i get this while compiling my game:

Code (glbasic) Select
BUILD STAGE 1: Compile and pack RELEASE
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\build.xml
Updated file C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\proguard.cfg
     [echo] Gathering info for glbasic...
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Handling aidl files...
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
    [javac] C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\src\com\glbasic\test\SDLActivity.java:17: warning: [deprecation] AbsoluteLayout in android.widget has been deprecated
    [javac] import android.widget.AbsoluteLayout;
    [javac]                      ^
    [javac] 1 warning
     [echo] No key.store and key.alias properties found in build.properties.
     [echo] Please sign C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\bin\glbasic-release-unsigned.apk manually
     [echo] and run zipalign from the Android SDK tools.

BUILD SUCCESSFUL
Total time: 15 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
     [echo] Gathering info for glbasic...
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Handling aidl files...
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
    [javac] C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\src\com\glbasic\test\SDLActivity.java:17: warning: [deprecation] AbsoluteLayout in android.widget has been deprecated
    [javac] import android.widget.AbsoluteLayout;
    [javac]                      ^
    [javac] 1 warning
[apkbuilder] Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
     [echo] Debug Package: C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\bin\glbasic-debug.apk
     [echo] Installing C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\bin\glbasic-debug.apk onto default emulator or device...

BUILD SUCCESSFUL
Total time: 24 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 54.5 sec. Time: 00:29
Build: 1 succeeded.


notice the next in the above output:
Code (glbasic) Select
[javac] C:\Users\JonasPM\Documents\GLBasic\DitraFall\distribute\Android\src\com\glbasic\test\SDLActivity.java:17: warning: [deprecation] AbsoluteLayout in android.widget has been deprecated
    [javac] import android.widget.AbsoluteLayout;
    [javac]                      ^
    [javac] 1 warning
Title: Re: Android and java 7
Post by: fivesprites on 2013-Mar-27
Google has decided that, in a future revision of the Android API, it will remove the AbsoluteLayout class.  Until then, it has marked it as "deprecated" which ensures that it will still operate, but they intend to delete at a later date.

It's only a warning and can safely be ignored.  GLB V11 beta removes the need for this code so will be fixed in a future release (if you are using the beta then you can simply remove the import line from SDLActivity.java).

Title: Re: Android and java 7
Post by: Jonás Perusquía on 2013-Mar-28
thank you for explaining fivesprites!