GLBasic forum

Main forum => Beta Tests => Topic started by: Kitty Hello on 2011-Apr-23

Title: Android - V10 release candidate
Post by: Kitty Hello on 2011-Apr-23
Hi,

http://www.glbasic.com/beta/glbasic_sdk.exe (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.


Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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.
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
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 :

Quote
WARNING: 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) :
Quote
C:\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...
Title: Re: Android - Beta SDK
Post by: doimus on 2011-Apr-23
Can this be installed alongside regular, non-beta GLB?
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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

Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
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 ?
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
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

Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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

Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
So, install everything they've got, eh ? :)
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
Quote
So, install everything they've got, eh ?

Wont hurt! ;) Hehehe

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
Busy installing now :)

No, still fails :(
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
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

Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
Ah, I've just tried to build an app without the USB cable plugged in to my phone and received this error:-

BUILD FAILED
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:639: The following error occurred while executing this line:
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:271: exec returned: 1

Dabz

Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
Right, with the USB plugged in, can you go to Apps->Settings->Applications

Then check if the these are ticked:-

- Unknown Sources                                       <---- Probably doesnt matter as the app gets signed as a debug app, but switch it on regardless
- Development->USB debugging                   <---- Important

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
Ah, I can't connect my tablet as there is no port for it to do so - in which case it does look as though the device must be connected...
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
Well, at least we know whats wrong... I had a feeling it had something do to with the USB cable, but I never realized you couldnt plug one in! :D

Anyway, what you've done isnt wasted, you can still build them...

Create a AVD (Android emulator) and get it running, then, try and build the project again... On my machine, when the phone is disconnected but the emulator is running, the application gets shunted onto the AVD (Note: Some stuff may not work as expected on an AVD as it does on hardware, this doesnt just apply to GLBasic apps, it happens even with native stuff)

Then, if its possible, you can just manually move the APK package that's  built onto your device and install it from there for actual testing on hardware (You may need to manually sign the app with keytool/jarsigner first)... That is, if its possible for you to do this.

Thing is though while testing, on the AVD, the application runs perfectly in a sense that my app is stretched to fit the screen, whereas on my actual device, its not, also, the colour parameter for DrawRect looks like its ignored on the AVD (Stays white) but works as expected on the device.

Dabz
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
Right, managed to get the resolution to shift up a bit by editing t the AndroidManifest.xml file:-

Code: GLBasic [Select]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.denathorngames.nagsheeddarts"
      android:versionCode="1"
      android:versionName="1.0">
          <supports-screens android:resizeable="false"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="false" />
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
        <uses-permission android:name="android.permission.INTERNET" />
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true">
        <activity android:name="org.libsdl.app.SDLActivity" android:label="@string/app_name" android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
 

Note this line:-

Code: GLBasic [Select]
android:anyDensity="false"
 

This makes Android scale the application, though, its not the general 'done thing', but works on my HTC Desire... The proper way is to scale everything up, but, that would mean changing loads of code, redoing my LoadBMP images etc etc

I'll get something up, push it about on a few devices and see whats what! :)

But, overall, it works well for me (apart from mp3's not playing, though, I will try OGG), and I must say, brilliant job!  :good:

Dabz

EDIT: Tried .ogg, it plays the file, sorta, I say sorta because you can hear the music, but its barely audible behind what I can only describe as machine gun fire! :)

Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-23
Unfortunately, even with an AVD running, the build failed.  It does look like a Windows 7 x64 problem or something is missing...

Do you have the NDK installed ?  I have the  Android 2.2 SDK installed - is that the right version ?
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-23
Nope, I havent installed the NDK... And yep, 2.2 is the one!

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
Time to see if its a x64 problem :)
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
I am using the x64 version of the JDK too - I wonder if only the 32-bit version works ?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
No luck with Windows XP in a Virtual Machine either :

BUILD FAILED
C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:472: The following error occurred while executing this line:
C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:203: apply returned: 255

Next need to try a proper XP machine
Title: Re: Android - Beta SDK
Post by: matchy on 2011-Apr-24
 :coke:

A simple print fps and coloured drawrect test which runs on my device (30fps) and on the emulator but there's no color...just white.
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-24
Quote
o luck with Windows XP in a Virtual Machine either :

Oh, your running on a VM, mines in Bootcamp so is a proper installation.

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
Yes, I'll be trying a proper XP machine later on...
Title: Re: Android - Beta SDK
Post by: trucidare on 2011-Apr-24
First of all - its a very very beta. only 32bit jdk works - but this isnt limited through glbasic, its from android sdk.

try to avoid spaces and brackets in you path - line 472 call the dex executable - works for me on windows 7 64 bit with jdk32 bit installed in c:\Programme
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
Tried with the 32-bit JDK too - but with no luck...

Quote
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

Shame more information cant be given about why its failing...
Title: Re: Android - Beta SDK
Post by: trucidare on 2011-Apr-24
check the JAVA_HOME path, sound like the path is set to jre and not jdk
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
Slight problem with the webOS packing too :

palm-package: illegal value for property "id" in C:\Users\Nicholas\Documents\GLBasic\Utilities\Plasma\Plasma.app\appinfo.json
It look like the %YOURCOMPANY_LOWERCASE% and %APPNAME_LOWERCASE% parameters aren't being filled in

Quote
check the JAVA_HOME path, sound like the path is set to jre and not jdk
This is my set of system variables:

Quote
ALLUSERSPROFILE=C:\ProgramData
ANDROID_SWT=C:\Android\android-sdk\tools\lib\x86
APPDATA=C:\Users\Nicholas\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=NICHOLAS-PC
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Nicholas
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_25
LOCALAPPDATA=C:\Users\Nicholas\AppData\Local
LOGONSERVER=\\NICHOLAS-PC
MinGW=C:\MinGW\bin
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
PalmPDK=C:\Program Files (x86)\Palm\PDK
PalmSDK=C:\Program Files (x86)\Palm\SDK
Path=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;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\MinGW\bin;C:\Program Files (x86)\Java\jdk1.6.0_25
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=170a
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Nicholas\AppData\Local\Temp
TMP=C:\Users\Nicholas\AppData\Local\Temp
USERDOMAIN=Nicholas-PC
USERNAME=Nicholas
USERPROFILE=C:\Users\Nicholas
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
windir=C:\Windows
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-24
Quote
try to avoid spaces and brackets in you path - line 472 call the dex executable - works for me on windows 7 64 bit with jdk32 bit installed in c:\Programme

Code: GLBasic [Select]
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_25
 

Maybe?

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
I do have no spaces in the XP Virtual Machine though - and that failed...

I'll be installing it with no spaces on a proper XP machine later on, and we'll see how it goes there.
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-24
Its been a right nightmare for you hasnt it... chin up though! ;)

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
I'm wondering whether there is too much being installed for the Android SDK - although it seems as though everything has to be selected before it will let you download it...

Soon know when I try it on the third machine :)
Title: Re: Android - Beta SDK
Post by: matchy on 2011-Apr-24
Some extended feedback; basic tested both in the emulator and Android device:

These work:
- 2d drawsprite/rotosprite/transparency
- 3d with poly colors and textures
- loadsprite/loadfont/loadsound
- alphamode
- playsound
- platform info including battery
- portrait/landscape; no need to set width/height
- getjoy sensor
- compiled and run old game
- compiled only box2d

These are not working properly:
- no device for platforminfo
- print; odd stretching for certain words/length
- drawrect/drawline; no color only white  :S
- poly draw not tested
Title: Re: Android - Beta SDK
Post by: Albert on 2011-Apr-24
It isn't install the APK to my Android device. I doesn't found the APK in my project dir or in the c:\Windows\temp

Quote
compile+link:
Android=D:\Andrtest\SRBSRC\prg\Sanyi\android
success
_______________________________________
*** Finished ***
Elapsed: 42.5 sec. Time: 19:38
Build: 1 succeeded.
Title: Re: Android - Beta SDK
Post by: Albert on 2011-Apr-24
I got that Succes message regardless I plugged or unplugged my Android.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
No luck with a proper XP machine either :

Quote
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:bb3ccd2f - 3D, NET
Wordcount:55 commands
compile+link:
BUILDSRIPT

BUILD FAILED
C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:472: The following error occurred while executing this line:
C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:203: apply returned: 255

Total time: 2 seconds
Android=C:\Documents and Settings\Jacky\My Documents\GLBasic\test\android
success

There must be something else that needs to be installed - or GLBasic can no longer be in a directory with a space...

Installed GLBasic inti C:\GLBasic - no difference
Tried a project directory with no spaces - no difference

Quote
BUILDSRIPT

BUILD FAILED
C:\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:639: The following error occurred while executing this line:
C:\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:271: exec returned: 1

Now I'm going to try a previous version of Java, just in case... 6u22 didn't help either...
Title: Re: Android - Beta SDK
Post by: matchy on 2011-Apr-24
As for the packaging, after I compile in glb then I open as an existing java android project and run it from eclipse with the device and emulator.

Quote
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:eb257ddf - 3D, NET
Wordcount:181 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...
    [javac] C:\Program Files (x86)\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
     [echo] Converting compiled files and external libraries into C:\GLBDev\Projects\droidtest\android\bin\classes.dex...
     [echo] Packaging resources
     [echo] Running zip align on final apk...
     [echo] Debug Package: C:\GLBDev\Projects\droidtest\android\bin\glbasic-debug.apk
     [echo] Installing C:\GLBDev\Projects\droidtest\android\bin\glbasic-debug.apk onto default emulator or device...

BUILD FAILED
C:\Program Files (x86)\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:639: The following error occurred while executing this line:
C:\Program Files (x86)\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:271: exec returned: 1

Total time: 7 seconds
Android=C:\GLBDev\Projects\droidtest\android
success
_______________________________________
*** Finished ***
Elapsed: 12.2 sec. Time: 05:27
Build: 1 succeeded.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
What are your system variables ?
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-24
Quote
As for the packaging, after I compile in glb then I open as an existing java android project and run it from eclipse with the device and emulator.

Eclipse.... You dont need Eclipse installed!?!

EDIT: Just reading everything

Dabz
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-24
Okay, for those it doesnt work, can you please subject you OS specs/device...

Dabz
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-24
You shouldnt need Eclipse... Anyone trying to build their app using it is wrong!

Dabz
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Apr-24
main_rules.xml:271: <-- no android device is connected - or - no developer mode was enabled on the device.
Title: Re: Android - Beta SDK
Post by: matchy on 2011-Apr-24
You shouldnt need Eclipse... Anyone trying to build their app using it is wrong!Dabz

How so?  8)

It's what I stumbled across to get it going. Although it's just a fast track to testing functions, until I work out the usb in glb compile.  ;)
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-24
As you all know, I've tried it on Windows XP (32 bit) SP3 and Windows 7 (64 bit) SP 1

Quote
main_rules.xml:271: <-- no android device is connected - or - no developer mode was enabled on the device.
Sounds like a device must be connected to compile then - which unfortunately rules out my current tablet...  Unless I get a USB to RJ-45 cable :)

Would it be possible so that compilation isn't dependant on a machine being present ?
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-25
Quote
Sounds like a device must be connected to compile then

I can compile for an AVD, I've done it... I've tested all screen resolutions under the emulator, plus, a running a 160DPI version of Nags... If I couldnt run a GLBasic app in the emulator, then I wouldnt of mentioned it... I'm probably the biggest fan og GLBasic+Android, I want it in... No questions, I've sent Gernot the APK file and everything... This does work on my machine!!!

Quote
You shouldnt need Eclipse... Anyone trying to build their app using it is wrong!

How so?

Because I've never need to use Eclipse for GLBasic apps... Eclipse is an unzip and be done IDE, as far as I know, it doesnt touch the registry, it makes no assumptions of work places... Its basically WYSIWYG.... This is why... You dont need it!

Dabz


Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-25
Wonder why mine dont - ironically the Windows 7 manages to get much further than XP (which fails more or less straight away) :)
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Apr-25
in compiler/platform/android/bin, there's a file glb_build.bat
There's a line:
call "%ANDROIDSDK%\tools\ant\bin\ant.bat" install -q

change that to
call "%ANDROIDSDK%\tools\ant\bin\ant.bat" debug

-> It should build the APK without a device now.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-25
Okay, I'll give that a go!

Much more info now : [aapt.exe] C:\Users\Nicholas\Documents\GLBasic\Utilities\Plasma\android\AndroidManifest.xml:8: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon').

The manifest file contains :

Quote
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.YOURCOMPANY_LOWERCASE.APPNAME"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
   <uses-permission android:name="android.permission.INTERNET" />
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true">
        <activity android:name="org.libsdl.app.SDLActivity" android:label="@string/app_name" android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Got it compiling now!  Turns out a new project had to be created - the one I was using (a V8 one) didn't have all the needed details...
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-25
My AndroidManifest.xml file:-

Code: GLBasic [Select]

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.denathorngames.nagsheeddarts"
      android:versionCode="1"
      android:versionName="1.0">
          <supports-screens android:resizeable="false"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="false" />
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
        <uses-permission android:name="android.permission.INTERNET" />
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true">
        <activity android:name="org.libsdl.app.SDLActivity" android:label="@string/app_name" android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
 

Though, please note, I've added the section:-

Code: GLBasic [Select]
<supports-screens android:resizeable="false"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="false" />
 

Manually!

Dabz
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-25
Quote
Got it compiling now!  Turns out a new project had to be created - the one I was using (a V8 one) didn't have all the needed details...

(http://i80.photobucket.com/albums/j197/veeveevee_2006/Smiley-Faint.gif)

:)

Seriously, I'm pleased you got it working MR T! <----- I aint going on no areoplane! :P Hehehe

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-25
Thats how I worked out it was the project contents causing the problem - note that in mine, the company fields aren't filled in.

Works fine on my tablet  :happy: I have to go through the network and install by copying from my machine to the tablet, which, as the screen is unresponsive, can take a while  :glare:

Would be handy if someone (ie Kitty :) ) did a V8 -> V9 project converter :)

Quote
eriously, I'm pleased you got it working MR T!
Same here too :)

Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-25
Quote
can take a while

I've found first load takes some doing, but afterwards,the app loads pretty quickly..
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-25
I meant that the screen is unresponsive - the loading time is pretty okay.

Further to the error message I was getting (Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon')), the problem is cause due to the fact that icons are only created when a project is created...
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-25
Testing on my Vector Editor program.  As previously stated, blue lines aren't being draw (or perhaps are the wrong colour - ie, black :) )

Grey rectangles are coming out white...

Now got a stylus for my tablet - works much better now!

I've included a picture of how it should look and what it does look like

[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: matty47 on 2011-Apr-26
Not sure but it looks like the build fails - even though the compiler returns with a success notification. All seems to go well until the following
Code: GLBasic [Select]
-dex:
     [echo] Converting compiled files and external libraries into C:\Users\mattk\Documents\GLBasic\MyProjs\TEXTURED_POLYGON\android\bin\classes.dex...
    [apply] Error occurred during initialization of VM
    [apply] Could not reserve enough space for object heap
    [apply] Could not create the Java virtual machine.

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

Total time: 4 seconds
Android=C:\Users\mattk\Documents\GLBasic\MyProjs\TEXTURED_POLYGON\android
success
_______________________________________
*** Finished ***
Elapsed: 12.0 sec. Time: 09:47
Build: 1 succeeded.
 
I am on Win 7 Home Prem. 64 bit with Java SDK (32 bit). I do have the Android SDK and Ant also separately installed however neither of these are set as environmental variables so I don't think they are being used.
Any ideas?
Thanks
Matthew
 
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-26
Make sure that the ANDOID_SWT system variable is set.  Might be worth activating verbose mode too - see Kitty's post about that.

And if its an old project, it will fail due to the fact that the android icon isn't present...
Title: Re: Android - Beta SDK
Post by: ampos on 2011-Apr-26
Be afraid my friends, of the day I got an Android...  >:D
Title: Re: Android - Beta SDK
Post by: matty47 on 2011-Apr-26
OK tried with the ANDROID_SWT variable set however same error. Message says something about not being able to start the java VM and dex failing (same as quoted previously)
Thanks
Matthew
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-26
Have a look at this : http://ycsoftware.net/error-occurred-during-initialization-of-vm-windows-7-windows-xp/

They seem to be saying that the Java Virtual Machine is corrupt...

This one http://geekycoder.wordpress.com/2009/07/08/java-tips-adventure-in-resolving-the-java-error-error-occurred-during-initialization-of-vm/ states that are there duplicate java.exe files, with the wrong one being found (and used).

Would also be worth checking JAVA_HOME and PATH too...

Quote
Be afraid my friends, of the day I got an Android...
We'll be on holiday when you do!
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-Apr-26
I get:

BUILDSRIPT
Buildfile: build.xml does not exist!
Build failed

The build.xml is where it should be and there are no spaces or funny characters to that directory.

Does it matter that GLBasic_beta is in my "Program Files (x86)" directory?

I know my Android SDK works as I have used it from Eclipse and another basic.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-26
That should be fine.

My installations are at :

C:\Program Files (x86)\GLBasic
C:\Android
C:\Program Files (x86)\Java\jdk1.6.0_25

Perhaps there are spaces in your GLBasic project directory ?
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-Apr-26
No, no spaces to the project file but thanks for asking.

Will try moving the other bits around and see if it helps.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-26
Are you using a new or current project ?
Title: Re: Android - Beta SDK
Post by: doimus on 2011-Apr-26
I can't yet compile for Android... but in the meantime, I've got one very strange issue with this beta.

Compiled Windows executables crash immediately after starting!  :blink:

I'm using WinXP in VirtualBox.
Those exes run fine in non-virtual Windows and in OSX.
Executables from non-beta GLB in VirtualBox are OK too.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-26
Could it be a driver issue?
Title: Re: Android - Beta SDK
Post by: mentalthink on 2011-Apr-26
Well for my works all OK, on windows 7 x64.
Well the emulator works, but it´s very very slow, running the android OS under virtual Box, is very fast the S.O, but I don´t know how send the .apk file into android under Virtual BOX.
Any link, or suggestion for made this?¿. Seems in Virtual Machine the OS, runs very very fast.

Kinds Regards
Iván J.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-26
My Windows executable crashed straight away in VM 4 :

*** Unhandled exception ***
   EXCEPTION_ACCESS_VIOLATION
 :S

Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-Apr-27
@MrTAToad

Yeah, its a new project. I have tried moving things around also but still no joy. Will keep messing though.

Got it working by moving my source to the C drive from D.

Things I have noticed:
The accelerometer works in reverse for left, right and up, down from the iPhone.
The multi-touch doesn't work. It only sees the first touch.
MP3 music didn't play but WAV sound fx are fine (as noted above I believe).

Amazed that it worked as well as it did with zero code changes.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-27
Indeed - what's left to do isn't that much really.

The compiler can't handle TRY/CATCH/THROW unfortunately - hopefully that will be sorted, otherwise I'll be needing to change a bit of code :)
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-Apr-27
Quote
MP3 music didn't play but WAV sound fx are fine (as noted above I believe).

I've had a report back from my test build of Nags that I've distributed that sound (PlaySound) doesnt work on LG Optimus One phones.... Their probably the best reasonably priced half decent ones you can get I think, which, I think will make them popular.

Also, is there a chance the two media volume control keys at the edge of devices can be mapped, or if they are, what do they fall under?

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-28
One thing I have found is that the keyboard has been completely disabled after exiting a Windows debug program.  Had to log off and then back on again to get it working...
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-28
Does loading bitmaps on Android work - mine seems to crash when attempting to do so...
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Apr-28
I did a quick test and, yes I could load sprites.

They must be in the "Media" directory!! I copy the contents of that to the android project on compile.
Title: Re: Android - Beta SDK
Post by: matchy on 2011-Apr-28
These work:
- loadsprite/loadfont/loadsound

I've only tested transparent PNG only (GLB website logo), smalfont.png and snd.WAV file formats.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-28
The BMP file was certainly present in the Media directory

Code: GLBasic [Select]
                PRINT "Ok1!",0,0; SHOWSCREEN; MOUSEWAIT
                LOADSPRITE "Media/line.bmp",self.sprite%
                PRINT "Ok2!",0,0; SHOWSCREEN; MOUSEWAIT

Ok1 was displayed, but when the screen was pressed, the program crashes to the main screen, with Ok2 not being displayed.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Apr-28
paste the logfile? In android/bin there's a file "_logview.bat"

If not, try:
Code: GLBasic [Select]
@ECHO OFF

:: install Android SDK, Android NDK
:: install JDK


set HERE=%~dp0

set ANDROIDSDK=%HERE%..\android-sdk-windows
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_24


set PATH=%JAVA_HOME%\bin;%PATH%

"%ANDROIDSDK%\platform-tools\adb.exe" shell logcat *:I


IF "%NOPAUSE%"=="" PAUSE
 
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-28
Once it's charged up, I'll try and find it.  The tablet goes through power like anything...

Another with - with the version number, I'm currently using 001.001, however, when packing for webOS, the routine is using a slightly different version string of :

creating package com.unmap.vectoreditor_000.001.0_all.ipk in C:\Users\Nicholas\Documents\GLBasic\Utilities\VectorEditor

The tablet crash seems to have sorted itself out now... :blink:
Title: Re: Android - Beta SDK
Post by: Albert on 2011-Apr-29
My project was on d: and my glbasic was on c: so the glb_build.bat cannot changed dir, because it should to change the drive first...
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Apr-29
OK. Will have to fix that, too.
Title: Re: Android - Beta SDK
Post by: Albert on 2011-Apr-29
Thank you. Everyhing working just fine and smooth! Except the music.  :nw:
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Apr-29
This is the log file crash I get when loading a bitmap (its either a sprite or a font file) :

Quote
D/alogcat ( 3240): stopping ...
D/alogcat ( 3240): stopped
D/alogcat ( 3240): starting ...
W/InputManagerService( 1412): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45e64278
D/StatusBar( 1412): ***** HomeKey Pressed
I/ActivityManager( 1412): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.wmt.launcher/com.android.launcher2.Launcher }
V/alogcat ( 3240): save instance
V/alogcat ( 3240): paused
W/InputManagerService( 1412): Ignoring hideSoftInput of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45e4e390
I/ActivityManager( 1412): No longer want android.process.media (pid 1689): hidden #16
D/alogcat ( 3240): stopping ...
D/alogcat ( 3240): stopped
D/Launcher.AllApps2D( 1562): -------------------------------showGroupedApps :8888 items NUM:41
D/dalvikvm( 1562): GC_EXTERNAL_ALLOC freed 788 objects / 38824 bytes in 141ms
I/ActivityManager( 1412): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.unmap.vectoreditor/org.libsdl.app.SDLActivity }
I/ActivityManager( 1412): Start proc com.unmap.vectoreditor for activity com.unmap.vectoreditor/org.libsdl.app.SDLActivity: pid=3371 uid=10045 gids={3003}
D/cursor  ( 1412): cursor_rotate 3
I/WindowManagerService( 1412): Setting rotation to 3, animFlags=1
I/ActivityManager( 1412): Config changed: { scale=1.0 imsi=0/0 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=1 layout=35 uiMode=17 seq=11}
D/StatusBarPolicy( 1412): ***** ro.wmt.ui.portrait.hide.capbtn = 1
D/StatusBarPolicy( 1412): ***** wm.getRotation = 3
D/dalvikvm( 3371): Trying to load lib /data/data/com.unmap.vectoreditor/lib/libSDL.so 0x45f044c8
D/dalvikvm( 3371): Added shared lib /data/data/com.unmap.vectoreditor/lib/libSDL.so 0x45f044c8
D/dalvikvm( 3371): Trying to load lib /data/data/com.unmap.vectoreditor/lib/libSDL_image.so 0x45f044c8
D/dalvikvm( 3371): Added shared lib /data/data/com.unmap.vectoreditor/lib/libSDL_image.so 0x45f044c8
D/dalvikvm( 3371): No JNI_OnLoad found in /data/data/com.unmap.vectoreditor/lib/libSDL_image.so 0x45f044c8, skipping init
D/dalvikvm( 3371): Trying to load lib /data/data/com.unmap.vectoreditor/lib/libmikmod.so 0x45f044c8
D/dalvikvm( 3371): Added shared lib /data/data/com.unmap.vectoreditor/lib/libmikmod.so 0x45f044c8
D/dalvikvm( 3371): No JNI_OnLoad found in /data/data/com.unmap.vectoreditor/lib/libmikmod.so 0x45f044c8, skipping init
D/dalvikvm( 3371): Trying to load lib /data/data/com.unmap.vectoreditor/lib/libSDL_mixer.so 0x45f044c8
D/dalvikvm( 3371): Added shared lib /data/data/com.unmap.vectoreditor/lib/libSDL_mixer.so 0x45f044c8
D/dalvikvm( 3371): No JNI_OnLoad found in /data/data/com.unmap.vectoreditor/lib/libSDL_mixer.so 0x45f044c8, skipping init
D/dalvikvm( 3371): Trying to load lib /data/data/com.unmap.vectoreditor/lib/libSDL_ttf.so 0x45f044c8
D/dalvikvm( 3371): Added shared lib /data/data/com.unmap.vectoreditor/lib/libSDL_ttf.so 0x45f044c8
D/dalvikvm( 3371): No JNI_OnLoad found in /data/data/com.unmap.vectoreditor/lib/libSDL_ttf.so 0x45f044c8, skipping init
D/dalvikvm( 3371): Trying to load lib /data/data/com.unmap.vectoreditor/lib/libmain.so 0x45f044c8
D/dalvikvm( 3371): Added shared lib /data/data/com.unmap.vectoreditor/lib/libmain.so 0x45f044c8
I/glbasic ( 3371): Updating media files
I/copyAssets( 3371): assets found, copying...
I/copyAssets( 3371): assets still up to date, cancelling...
I/glbasic ( 3371): done with updating
I/glbasic ( 3371): external files dir is /data/data/com.unmap.vectoreditor/files
I/SDL     ( 3371): onResume()
I/ActivityManager( 1412): Displayed activity com.unmap.vectoreditor/org.libsdl.app.SDLActivity: 3775 ms (total 3775 ms)
I/SDL     ( 3371): pixel format unknown -1
I/SDL     ( 3371): SDL_Android_Init()
I/glbasic ( 3371): SDL_init video
I/glbasic ( 3371): SDL_GetVideoInfo = 480x800 @ 16 bpp
I/glbasic ( 3371): Setting video mode: 480x800x16 fl=4800000
I/SDL     ( 3371): [STUB] GL_LoadLibrary
V/SDL     ( 3371): Starting up OpenGL ES 1.1
D/libEGL  ( 3371): egl.cfg not found, using default config
D/libEGL  ( 3371): loaded /system/lib/egl/libGLES_android.so
I/glbasic ( 3371): SDL_SetVideoMode seems to be 1
I/glbasic ( 3371): BGRA ext NOT supported
I/glbasic ( 3371): GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get GL_OES_query_matrix GL_OES_EGL_image GL_OES_compressed_ETC1_RGB8_texture GL_ARB_texture_compression GL_ARB_texture_non_power_of_two GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap
I/glbasic ( 3371): set cdir to: /data/data/com.unmap.vectoreditor
I/glbasic ( 3371): exepath=curdir= /data/data/com.unmap.vectoreditor
V/SDL     ( 3371): SDL audio: opening device
V/SDL     ( 3371): SDL audio: wanted stereo 16-bit 44.1kHz, 4096 frames buffer
V/SDL     ( 3371): SDL audio: got stereo 16-bit 44.1kHz, 16384 frames buffer
I/glbasic ( 3371): set cdir to: files
I/glbasic ( 3371): Init Finalized
I/DEBUG   ( 2281): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 2281): Build fingerprint: 'generic/generic/generic/:2.2/Froyo/v1.2.0-20110321.152349:eng/'
I/DEBUG   ( 2281): pid: 3371, tid: 3382  >>> com.unmap.vectoreditor <<<
I/DEBUG   ( 2281): signal 7 (SIGBUS), fault addr 00000000
I/DEBUG   ( 2281):  r0 00000000  r1 0022e20e  r2 00003036  r3 4882b70a
I/DEBUG   ( 2281):  r4 81d25590  r5 439b2008  r6 0021ea18  r7 42086fc0
I/DEBUG   ( 2281):  r8 4882bd58  r9 42086fb8  10 42086fa4  fp 4882b6e4
I/DEBUG   ( 2281):  ip 00000000  sp 4882b6d0  lr 81c82f0c  pc 81c82f70  cpsr 60000010
D/dalvikvm( 1412): GC_EXPLICIT freed 13277 objects / 729424 bytes in 269ms
I/DEBUG   ( 2281):          #00  pc 00082f70  /data/data/com.unmap.vectoreditor/lib/libmain.so
I/DEBUG   ( 2281):          #01  lr 81c82f0c  /data/data/com.unmap.vectoreditor/lib/libmain.so
I/DEBUG   ( 2281):
I/DEBUG   ( 2281): code around pc:
I/DEBUG   ( 2281): 81c82f50 e51b3008 e1a03c23 e1822003 e51b3014
I/DEBUG   ( 2281): 81c82f60 e5832000 ea000002 e51b2008 e51b3014
I/DEBUG   ( 2281): 81c82f70 e5832000 e3a03001 e1a00003 e24bd004
I/DEBUG   ( 2281): 81c82f80 e8bd8800 e92d4800 e28db004 e24dd008
I/DEBUG   ( 2281): 81c82f90 e50b0008 e1a03001 e14b30ba ebff83d3
I/DEBUG   ( 2281):
I/DEBUG   ( 2281): code around lr:
I/DEBUG   ( 2281): 81c82eec e1a03000 e2233001 e20330ff e3530000
I/DEBUG   ( 2281): 81c82efc 0a000001 e3a03000 ea00001b ebff83f8
I/DEBUG   ( 2281): 81c82f0c e1a03000 e3530000 03a03000 13a03001
I/DEBUG   ( 2281): 81c82f1c e20330ff e3530000 0a00000f e51b3008
I/DEBUG   ( 2281): 81c82f2c e1a02c03 e51b3008 e1a03403 e20338ff
I/DEBUG   ( 2281):
I/DEBUG   ( 2281): stack:
I/DEBUG   ( 2281):     4882b690  afd41b6c  /system/lib/libc.so
I/DEBUG   ( 2281):     4882b694  00000004 
I/DEBUG   ( 2281):     4882b698  00000ffe 
I/DEBUG   ( 2281):     4882b69c  00000004 
I/DEBUG   ( 2281):     4882b6a0  4882b716 
I/DEBUG   ( 2281):     4882b6a4  81d25590  /data/data/com.unmap.vectoreditor/lib/libmain.so
I/DEBUG   ( 2281):     4882b6a8  439b2008 
I/DEBUG   ( 2281):     4882b6ac  0021ea18  [heap]
I/DEBUG   ( 2281):     4882b6b0  42086fc0 
I/DEBUG   ( 2281):     4882b6b4  81c64bd8  /data/data/com.unmap.vectoreditor/lib/libmain.so
I/DEBUG   ( 2281):     4882b6b8  4882b720 
I/DEBUG   ( 2281):     4882b6bc  00000004 
I/DEBUG   ( 2281):     4882b6c0  4882b6dc 
I/DEBUG   ( 2281):     4882b6c4  0001b6f8  [heap]
I/DEBUG   ( 2281):     4882b6c8  df002777 
I/DEBUG   ( 2281):     4882b6cc  e3a070ad 
I/DEBUG   ( 2281): #00 4882b6d0  4882b70a 
I/DEBUG   ( 2281):     4882b6d4  4882b6f8 
I/DEBUG   ( 2281):     4882b6d8  4882b716 
I/DEBUG   ( 2281):     4882b6dc  00003036 
I/DEBUG   ( 2281):     4882b6e0  4882b784 
I/DEBUG   ( 2281):     4882b6e4  81c932e0  /data/data/com.unmap.vectoreditor/lib/libmain.so
I/DEBUG   ( 2281):     4882b6e8  00201038  [heap]
I/DEBUG   ( 2281):     4882b6ec  008000ff 
I/DEBUG   ( 2281):     4882b6f0  0021f228  [heap]
I/DEBUG   ( 2281):     4882b6f4  4882b7a0 
I/DEBUG   ( 2281):     4882b6f8  afd41b6c  /system/lib/libc.so
I/DEBUG   ( 2281):     4882b6fc  00000000 
I/DEBUG   ( 2281):     4882b700  00003036 
I/DEBUG   ( 2281):     4882b704  00000006 
I/DEBUG   ( 2281):     4882b708  00211e60  [heap]
I/DEBUG   ( 2281):     4882b70c  80c1e870  /system/lib/libdvm.so
I/DEBUG   ( 2281):     4882b710  4882b720 
I/DEBUG   ( 2281):     4882b714  424dd794 
D/Zygote  ( 1178): Process 3371 terminated by signal (7)
I/ActivityManager( 1412): Process com.unmap.vectoreditor (pid 3371) has died.
I/WindowManagerService( 1412): WIN DEATH: Window{46076b40 com.unmap.vectoreditor/org.libsdl.app.SDLActivity paused=false}
I/WindowManagerService( 1412): WIN DEATH: Window{46099f28 SurfaceView paused=false}
D/cursor  ( 1412): cursor_rotate 0
I/WindowManagerService( 1412): Setting rotation to 0, animFlags=1
I/ActivityManager( 1412): Config changed: { scale=1.0 imsi=0/0 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=2 layout=35 uiMode=17 seq=12}
I/UsageStats( 1412): Unexpected resume of com.wmt.launcher while already resumed in com.unmap.vectoreditor
I/BootReceiver( 1412): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
D/StatusBarPolicy( 1412): ***** ro.wmt.ui.portrait.hide.capbtn = 1
D/StatusBarPolicy( 1412): ***** wm.getRotation = 0
W/InputManagerService( 1412): Got RemoteException sending setActive(false) notification to pid 3371 uid 10045
D/dalvikvm( 1412): GC_EXPLICIT freed 3708 objects / 875432 bytes in 159ms
D/StatusBar( 1412): ***** HomeKey Pressed
I/ActivityManager( 1412): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.wmt.launcher/com.android.launcher2.Launcher }
D/dalvikvm( 1562): GC_EXTERNAL_ALLOC freed 1137 objects / 53816 bytes in 136ms
I/ActivityManager( 1412): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.jtb.alogcat/.LogActivity bnds=[223,43][301,141] }
D/alogcat ( 3240): stopping ...
D/alogcat ( 3240): canceling periodic saves
D/alogcat ( 3240): starting ...
V/alogcat ( 3240): started
V/alogcat ( 3240): resumed

[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: Albert on 2011-Apr-30
I've compiled my game to Android and I found, that if I move/turn my device my hero walk and jump. I'm implemented some joypad support, so I think there is some joy and accelerometer issue.
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-01
This is AWESOME! Thanks, Danke! Einfach toll! Great!  :happy:

Any ETA when this will be in the official non beta version? :)

Cheers - Xaron
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02

These are not working properly:
- drawrect/drawline; no color only white  :S

Hmm... works for me on my Android.

edit: Is there a way to disable the debug mode yet? I have around 2-5 FPS on my Desire HD.
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
Ok, one thing which is driving me crazy are the different device resolutions for Android:

So my game has a resolution of 480x320 but I get a black border on my Desire HD (which has 800x480):

(http://www.machgames.de/dl/wh/screenshots/wh_104e_desirehd.jpg)

Is there a way to center that image? I don't want to stretch it to full size just want to keep the aspect ratio and stretch it.

Here's a screeny from a Wildfire:

(http://www.machgames.de/dl/wh/screenshots/wh_104e_wildfire.jpg)

Same problem but now the menu on the right site is missing because it has only 320x240...
Title: Re: Android - Beta SDK
Post by: Ian Price on 2011-May-02
OOOHH!!! That game looks lovely Xaron!

Any chance of sharing a demo with the community?

I love tactical games like Advance Wars, HistoryLine 1914-1918 and Battle Isle etc. That looks like it'll keep me happy for a while.

Will you only be releasing for Android devices - I don't have one of those :(
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
OOOHH!!! That game looks lovely Xaron!

Any chance of sharing a demo with the community?

I love tactical games like Advance Wars, HistoryLine 1914-1918 and Battle Isle etc. That looks like it'll keep me happy for a while.

Will you only be releasing for Android devices - I don't have one of those :(

Thanks! :) It will be definitely available for iPhone and Android, thats why we use that 480x320 resolution. But this gives me headaches regarding the crude aspect ratio of Android devices. I get it stretched to fullscreen but not centered...
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-02
Did you try Dabz's solution:
http://www.glbasic.com/forum/index.php?topic=6163.msg48827#msg48827 (http://www.glbasic.com/forum/index.php?topic=6163.msg48827#msg48827)
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
Did you try Dabz's solution:
http://www.glbasic.com/forum/index.php?topic=6163.msg48827#msg48827 (http://www.glbasic.com/forum/index.php?topic=6163.msg48827#msg48827)

Thanks yes. That's why it already scales up correctly. But it would be great to have it scaled up/down AND centered. Just a minor issue at the moment though. Is there any lower level stuff I could initialize during the startup, something like a general transformation matrix?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-02
There isn't a way of centring the screen automatically - of course, if you knew the screen resolution, you could do it yourself.

I'm testing GETDESKTOPSIZE at the moment to see if it returns the devices resolution at the current orientation.
Title: Re: Android - Beta SDK
Post by: matchy on 2011-May-02

These are not working properly:
- drawrect/drawline; no color only white  :S

Hmm... works for me on my Android.

Prove it!
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-02
It's because the device doesn't support some GL extensions (glLine - or more likely GL_LINE) being one of them.

It's the same on my tablet - its why my marketplace screenshots look awful :)
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02

These are not working properly:
- drawrect/drawline; no color only white  :S

Hmm... works for me on my Android.

Prove it!

LOL... Alright, why not.  :whistle:

(http://www.xaron.net/dl/glbasic/images/lines.jpg)

Sorry for the poor photo, it's just a snapshot from my HD desire.

Code:

Code: GLBasic [Select]
        FOR i = 1 TO 400
                DRAWLINE 0, 0, 400-i, i, RGB(RND(255), RND(255), RND(255))
        NEXT
 
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-02
And this is my tablet :)



[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: Ian Price on 2011-May-02
It looks like all Android devices are equal - except that some are more equal than others :P ;)
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
LOL!

MrTAToad, what tablet do you have?
Title: Re: Android - Beta SDK
Post by: ampos on 2011-May-02
Mr.TaToad, did you pay 25$ for publishing your apps?
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
Mr.TaToad, did you pay 25$ for publishing your apps?

He has. There is no other way. ;)
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-02
Its a WonderMedia tablet.  Whilst it does have the Android Marketplace, its not the official one :)

Its best to get  proper tablet - unfortunately they aren't that cheap...

Quote
Mr.TaToad, did you pay 25$ for publishing your apps?
Oh yes!
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
There isn't a way of centring the screen automatically - of course, if you knew the screen resolution, you could do it yourself.

Getting the screen resolution is not the problem but how do I shift the whole screen using GLBasic?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-02
GETDESKTOPSIZE seems to work (although I dont know yet whether the values change depending on orientation) - you would then be able to centre using that as long as you know how big your play area is.
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-02
GETDESKTOPSIZE seems to work (although I dont know yet whether the values change depending on orientation) - you would then be able to centre using that as long as you know how big your play area is.

Maybe I'm too stupid but do you have some lines of code how to translate a screen in x and y direction? Is there a way to change the transformation matrices in GLBasic?
Title: Re: Android - Beta SDK
Post by: Ian Price on 2011-May-02
Something like this -

Code: GLBasic [Select]
FUNCTION centre:

LOCAL actual_width, actual_height
LOCAL screen_width, screen_height

screen_width=100
screen_height=200

GETSCREENSIZE actual_width, actual_height

LOCAL xpos, ypos

xpos=(actual_width-screen_width)/2
ypos=(actual_height-screen_height)/2

WHILE TRUE

DRAWRECT xpos,ypos,screen_width, screen_height,RGB(255,0,0)

SHOWSCREEN

WEND

ENDFUNCTION
 

Obviously this is a simple function to draw a square at the centre of any sized screen (that's bigger than the square). But the same principal would apply to a drawn screen.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-02
Although it might be best to use GETDESKTOPSIZE  :)
Title: Re: Android - Beta SDK
Post by: Slydog on 2011-May-02
I haven't read all 8 pages of this thread, so I may be missing the point here.
If you want a game ALWAYS centered and don't want to draw the game in the top-left corner and then move it later, why not program all your routines to have a center of (0,0) for the middle of the screen, then adjust the actual offset later.

Something like:
Code: GLBasic [Select]
TYPE TVector
  x
  y
ENDTYPE

GLOBAL _center AS TVector  // 'Center' of screen
GLOBAL _screen AS TVector // Screen dimensions

// Do once at program start, or screen resize or orientation change
GETDESKTOPSIZE _screen.x, _screen.y
_center.x = _screen.x / 2.0
_center.y = _screen.y / 2.0

...

LOCAL object_pos AS TVector

// centered sprite
object_pos.x = 0
object_pos.y = 0
DrawSpriteCentered(1, object_pos)

// sprite 100 pixels left of center, 50 pixels below center
object_pos.x = -100
object_pos.y = 50
DrawSpriteCentered(1, object_pos)

...

FUNCTION DrawSpriteCentered%: sprite_id%, pos AS TVector
  LOCAL vc AS TVector
  vc = ConvertCenter(pos)
  DRAWSPRITE sprite_id, vc.x, vc.y
ENDFUNCTION

FUNCTION ConvertCenter AS TVector: xy AS TVector
  LOCAL v AS TVector
  v.x = _center.x + xy.x
  v.y = _center.y + xy.y
  RETURN v
ENDFUNCTION
 

Then no matter what screen size you have, the game will always be centered, with blank borders depending on the difference.
Title: Re: Android - Beta SDK
Post by: Ian Price on 2011-May-02
Although it might be best to use GETDESKTOPSIZE  :)

That's what I meant. D'oh. The code should still be the same though.
Title: Re: Android - Beta SDK
Post by: ampos on 2011-May-03
There isn't a way of centring the screen automatically - of course, if you knew the screen resolution, you could do it yourself.

Getting the screen resolution is not the problem but how do I shift the whole screen using GLBasic?

If you create a viewport, all the draw will be shifted. The 0,0 coord is the 0,0 of the viewport not the screen. I don't know it was intended that way by Gernot, but this is how it works.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-03
Yes, that's how Viewport is designed to be.
Also, you could render into an offscreen (CREATESCREEN) and paste that centered. With the offscreen surface you might even get better compatibility of the GRAB... commands.
Title: Re: Android - Beta SDK
Post by: Xaron on 2011-May-03
Thanks for your help guys, will dig deeper into this! :)

Does this has an effect on LOADBMP as well?
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-03
Yes. When you render offscreen, you should use loadsprite/drawsprite instead of loadbmp.
Title: Re: Android - Beta SDK
Post by: matchy on 2011-May-03
LOL... Alright, why not.  :whistle:

Thanks! :)

Now how does that explain the why there's no colour on the emulator?  :zzz:
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-03
The emulator has just the very very basic features emulated I think.

If you want coloured lines, use a 1 pixel polyvector with a coloured texture. That's also a lot faster.
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-May-03
Quote
Now how does that explain the why there's no colour on the emulator

As far as I know, anything the emulator spits out shouldnt be taken as gospel, also, GLBasic isnt the only software I've used for Android that goes a little wobbly in the emulator, Libgdx suffers from quiffiness too, but, as far as I can see, both work fine (Within reason for GLBasic as its in beta) on an actual device.

Dabz
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-03
Its pretty stable really - which is good!
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-04
OK, new beta SDK is online.
http://wwww.glbasic.com/beta/glbasic_sdk.exe (http://wwww.glbasic.com/beta/glbasic_sdk.exe)

Fixes:
Code: GLBasic [Select]
        // New command:
        //    SOCK_GETREMOTEIP, SOCK_GETREMOTEPORT
        //    SOCK_SETBLOCKING
        //    X_GETMATRIX
        //
        // Editor:
        //    New function File/Project/Clean up
        //    that cleans out build files.
        //    User keywords must be 2 characters long at least now.
        //    Icons must be transparent PNG for transparency now.
        //    Icons are scaled using bicubic filter -> excellent quality.
        //    gbas/gbap files have different icons now.
        //    Mac-Icons are generates from the icon.png file.
        //
        //    Project options -> Version number is available.
        //    You can query it with PLATFORMINFO$("VERSION").
        //
        //    All platforms except iPhone built into the .app directory.
        //
        // Core:
        //    INKEY$ works much better and buffers multiple
        //    key presses druing one showscreen cycle (up to 16).
        //    INKEY$/INPUT$ returned \r instead of \n. Bug is fixed.
        //
        //    URLENCODE$/URLDECODE$ caused wrong output with
        //    codes>127. It will be converted ISO 8859-1 to UTF-8 first
        //    so php can properly interact with GLBasic now.
        //
        //    Shoebox leaked memory.
        //
        //    CONSTANT yielded compiler errors (assign to const object).
        //
        //    GRABSPRITE id,0,0,0,0 frees the memory. Was a bad leak.
        //
        // Compiler:
        //    Nested ?IFDEF might have caused trouble.
        //    ?DEFINE always was triggered.
        //    2-pass-compiler implemented. GLOBAL declarations
        //    from other files are known in stage 2 now.
        //    This allows:
        //    INC foo.bar; TYPE Tfoo; bar; ENDTYPE; GLOBAL foo AS Tfoo
        //
        // iPhone:
        //    SLEEP is working properly now.
        //
        // Pandora:
        //    GLBasic builds a full featured .pnd package for you.
        //    The screen size is not fixed anymore, allowing it to run
        //    on OMAP-3 devices as well.
        //
        // WebOS:
        //    appinfo.json is filled with version number and proper strings.
        //
        // Android:
        //    possible crash at startup fixed.
        //    Fix with spaces in path (GLBasic installation or project path)
 
Title: Re: Android - Beta SDK
Post by: Dabz on 2011-May-04
Wow, nice update... Good work Kitty! :D

Dabz
Title: Re: Android - Beta SDK
Post by: matchy on 2011-May-04
Yes...compiled Android successfully compiled and was able to install the package. :)  :booze:
Title: Re: Android - Beta SDK
Post by: Qube on 2011-May-04
X_GETMATRIX command, woohoo, many thanks for adding that in, fantastic help  :nw:
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-05
I get a hang on exit with the new beta. Same code that worked with the previous beta.
This was on an HTC Desire 2.2.

Getting better FPS with this beta. It was about 40 FPS but now its about 50 :)
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-05
If it hangs on exit, can you post the logfiles? (android/bin/viewlog.bat)
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-05
I sure will when I get home from work Kitty.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-05
The following doesn't appear to be working :


ooh - almost forgot : CREATESCREEN seems to be not working too
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-05
Oh my. That's such a huge list. I wonder what's wrong with my OpenGL setup.
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-05
CREATESCREEN must be working as my game uses it for the level background and final rendering. Maybe the size is too big?
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-05
If createscreen does not work, there's really a serious problem. This extension is really important.

Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-05
I wouldn't be surprised if my tablet doesn't support the extension for CREATESCREEN, which is going to make displaying results... fun... :)

Mind you, I've got an Android phone coming in a week or so, so hopefully it will all be okay on that...  However, the good news is my program didn't crash when exiting  =D

Could you add 480 x 800 (and 800 x 480) to the resolution list too, please (thats my tablet resolution size)
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-05
The current beta should have 480x800 as a resolution suggestion in the box. No?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-05
Yes, it does - didn't look there  :whistle:
Title: Re: Android - Beta SDK
Post by: Albert on 2011-May-06
I'm using CREATESCREEN, and it's working on Android.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-06
Awesome. Does GRABSPRITE work, too?
Title: Re: Android - Beta SDK
Post by: Moru on 2011-May-07
GLBasic IDE, Version: 9.089

I'm running the following code to get a message over UDP network protocol.

Code: GLBasic [Select]
rv = SOCK_RECV(sock, msg$, 999)
src_ip = SOCK_GETREMOTEIP(sock)
src_port = SOCK_GETREMOTEPORT(sock)
IF rv>0 THEN log("message recieved: ["+src_ip+"]["+src_port+"]["+msg$+"]")
 

The src_ip and src_port both ends up as 0 instead of the integers I'm expecting.

Full source below, change IP in the source to your ip, or just type in "localhost" at the promt and press enter.

Code: GLBasic [Select]
// --------------------------------- //
// Project: NetUDPThruRouter
// Start: Tuesday, September 15, 2009
// IDE Version: 7.104

// Works if you send a message from inside the firewall to the outside IP of the other client
// And then send a message from that client on the outside of the firewall to the inside.
// Both clients can be behind a firewall.


GLOBAL sock%               // The socket connection
GLOBAL port% = 15000       // Port number to use

LOCAL ok%, ip%, rv%, msg$
LOCAL myip$
LOCAL destip$
LOCAL timeout
LOCAL src_ip%, src_port%                // The ip-address and port of the last packet

myip$ = NETGETIP$()        // Get our local IP just for the show
log("Our IP: "+ myip$)

STDOUT "\nDestination IP: "
destip$ = STDIN$()
// Just for less typing when testing
IF destip$ = "" THEN destip$ = "127.0.0.1"

ok = SOCK_INIT()    // Init network
IF ok
    sock = SOCK_UDPOPEN(port)           // Get the socket so we can send/recieve on the port
    IF sock <> -1
                SOCK_SETBLOCKING sock, FALSE    // Set socket to blocking(true), wait until message was sent or recieved

        ip = SOCK_GETIP(destip$)        // Convert the string to an integer IP
        // Send 32 packets, waiting one second for an answer between each send
        FOR n = 0 TO 31
            log("Sending message: "+"Hello from "+myip$+" To: "+destip$)
            ok = SOCK_UDPSEND(sock, "Hello from "+myip$, ip, port)
            IF ok <> -1
                log("message sent with "+ok+" bytes")
                timeout = GETTIMERALL() + 1000      // Start timer for one second
                WHILE rv <> -1 AND GETTIMERALL() < timeout
                    rv = SOCK_RECV(sock, msg$, 999)
                                        src_ip = SOCK_GETREMOTEIP(sock)
                                        src_port = SOCK_GETREMOTEPORT(sock)
                    IF rv>0 THEN log("message recieved: ["+src_ip+"]["+src_port+"]["+msg$+"]")
                    IF rv=-1
                        log(NETGETLASTERROR$())     // Didn't work, tell user why
                        SOCK_CLOSE(sock)
                    ENDIF
                WEND
            ELSE
                log(NETGETLASTERROR$())
            ENDIF
        NEXT
    ELSE
        log(NETGETLASTERROR$())
    ENDIF
ELSE
    log(NETGETLASTERROR$())
ENDIF
KEYWAIT



FUNCTION log: str$
    STDOUT "\n"+str$
ENDFUNCTION
Title: Re: Android - Beta SDK
Post by: Moebius on 2011-May-08
I'd really like to thank Gernot and anyone else who's put this together because most things are working brilliantly on yet another platform.  :good:

Doing testing on Android, I've noticed that multitouch doesn't seem to be supported (GETMOUSECOUNT returns 1 on my device).  I'm not sure if this is a cause for alarm, but also the values returned by GETJOYX, Y, and Z seem to be rounded off to the nearest multiple of "0.1019318253"...  Simple APK for displaying mouse, joy values: http://www.multiupload.com/79I8CYGRWZ (http://www.multiupload.com/79I8CYGRWZ)
Will keypresses be implemented on Android?  Many users have hardware keyboards, and there are significant buttons on every device (back button, menu button).
Eventually, it would be good to have control over what the back button does, rather than just quitting the app whenever it's bumped.  Also, apps at the moment seem to crash when the device is put into standby mode, and crash when multitasking (i.e. whenever the home button is used).
Title: Re: Android - Beta SDK
Post by: trucidare on 2011-May-08
GLBasic Apps working on Android 2.3.4
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-08
I presume it also works on 3.0
Title: Re: Android - Beta SDK
Post by: Moebius on 2011-May-09
Should have mentioned I'm using 2.3.2 - not officially released yet for my device as well...  So there isn't any accelerometer issue on later versions?
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-09
I don't think multimouse is a good idea. There's a hug majority of deviecs with just one touch.
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-09
@kitty
Cant you just set the mouse count to 1 for those devices?

It totally breaks my game as I have left, right and jump as on screen buttons. I am more than happy to assign them to keys on other devices but my HTC Desire doesn't have any, so my game would be useless on that device if I cant implement multi touch.

Or have I not understood what you mean?

Title: Re: Android - Beta SDK
Post by: Moebius on 2011-May-09
It would be a shame not to be able to use multitouch...  There are many devices that do support it, and many more will in the future.
I haven't seen anything about getting the maximum number of pointers possible, but to handling multiple pointers in events doesn't seem to be too difficult, at least on the android side of things: http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html (http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html)
I'm not sure about how multiple mice are handled internally by GLB, but surely multitouch is possible?   :doubt:
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-09
Yes, it's possible. I'll implement it. But I warn you to use it, because many devices are not able to use it and your game will not run there.
Title: Re: Android - Beta SDK
Post by: erico on 2011-May-09
on the multi-touch issue...

Wouldn´t you think it´s possible to, let´s say, having a check on different screen pressed areas while alternating this between code loops? Would this achieve a ´multi touch´ sort of thing?

just some crazy idea :x
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-10
@kitty
What other input do you have on your phone other than the touch screen?

Just thinking of what else to implement other than touch screen, such as the optical scroll and would we get access to such things through glbasic?
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-10
Never heared of "optical scroll". Am I getting old now? :)

I think about touches, keyboard and acceleration values as input.
Title: Re: Android - Beta SDK
Post by: 404 Not Found on 2011-May-10
"optical scroll" is just a different kind of D-Pad. Some of the HTC Desire phones have these:
(http://3.bp.blogspot.com/_dnc8z5MMNQ8/TNzVhTIDSNI/AAAAAAAAAGE/bayBZh0oKZ4/s400/HTC_Desire_Z_02-420-90.jpg)
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-10
Ah. I think that's handled as if it was a dpad (KEY) then.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-10
Get the update for the beta now. See 1st post.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-10
JPegs on Windows seem fine - now to test Linux, webOS and Android :)

Linux seems okay!
webOS crashes straight out (after a black screen)
Windows CE emulator displays my first image and seems to hang
Android displays two imagew then crashes

There seems to be an extra set of quote marks in the glb_install_and_pack batch file - it seems the palm-package program didn't like that...
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-11
oh. Can you fix it?

It must work with spaces in the path, mind.
Title: Re: Android - Beta SDK
Post by: 404 Not Found on 2011-May-11
Thanks for getting the keyboard working! However, there are still some minor flaws:
- Space isn't detected yet
- Pressing X exits the app
- For landscape apps the D-Pad directions are rotated by 90° by default because portrait orientation is hard-coded into the manifest. You have to change it manually, but it would be nice if it's set automatically depending on project settings.
- Sliding the keyboard out exits the app. To prevent this, you need to add android:configChanges="keyboardHidden|orientation" to the <activity> tag in the manifest file. This should also be included in the template project.

Concerning the crash/segfault on closing - here is the debug log from a device (Motorola Milestone, Android 2.2.1/Cyanogen 6.1):
Code: GLBasic [Select]
I/SDL     ( 4497): [STUB] GL_UnloadLibrary
D/dalvikvm( 4497): threadid=9: thread exiting, not yet detached (count=0)
D/dalvikvm( 4497): threadid=9: thread exiting, not yet detached (count=1)
E/dalvikvm( 4497): threadid=9: native thread exited without detaching
E/dalvikvm( 4497): VM aborting
I/DEBUG   ( 4448): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 4448): Build fingerprint: 'MOTO_RTEU/umts_sholes/umts_sholes/sholes:2.2.1/SHOLS_U2_05.26.3/296482885:user/release-keys'
I/DEBUG   ( 4448): pid: 4497, tid: 4505  >>> com.yourcompany.test <<<
I/DEBUG   ( 4448): signal 11 (SIGSEGV), fault addr deadd00d

For further explanation I'll just quote quote from here (http://stackoverflow.com/questions/4202670/objdump-of-a-so-file-need-help-to-understand-the-messages):
Quote
FWIW, fault address "deadd00d" indicates a deliberate VM abort. Before aborting the VM writes an explanation to the log file; you should see it up above what you pasted here.
So there's a thread exiting without being detached from the VM, therefore the VM exits too. This seems to happen right after GL_UnloadLibrary is called, so that's the place where to look for it.

Another thing is that I found many exit()s in the code. You really should avoid using that since Android is designed to care of exiting applications itself. You should just close your activity instead (Activity.finish() from Java; read this (http://groups.google.com/group/android-ndk/browse_thread/thread/4fa32379243333f8) if you want to call it from a different thread).
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-11
I had to get rid of the extra quotes to get the palm program to run - its possible that it may work on XP machines though... :zzz:
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-13
Hotpatch 2 released. The 3D examples work all properly now.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-13
Will be downloading it later and giving it a good poke...
Title: Re: Android - Beta SDK
Post by: ampos on 2011-May-13
Hotpatch 2 released. The 3D examples work all properly now.

Is the jpeg thing fixed for WebOS? (just for testing...)
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-13
It's compiled wit -O0, yes. I hope it's fixed.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-13
Unfortunately it crashes out.. :(
Title: Re: Android - Beta SDK
Post by: ampos on 2011-May-13
The jpeg library also saves?

Code: GLBasic [Select]
SAVEBMP "image.jpg"
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-13
Yes. If the first character of the file extension is a "j".
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-13
Android crashes with JPEG too

There are no textures with webOS 3D

With the hot hot fix, it's getting a bit further on the Pre (the first jpeg is displayed), but it seems to crash on the LOADSPRITE "",1 part...

Android displays the first two pictures and then crashes


[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-14
Everything (everything I can test that is :) ) apart from the Windows CE Emulator version is working - that just hangs after displaying a picture.  No idea if the same thing happens on a real machine though...

Only thing left to do for this update is sorting the %% in the json file...
Title: Re: Android - Beta SDK
Post by: freedomdown on 2011-May-14
Is it possible to support the hardkeys on the phone like search, back and menu?

As that would solve the porblem of no multitouch on some phones for me.
Here's a link I found on the subject:
http://android-developers.blogspot.com/2009/12/back-and-other-hard-keys-three-stories.html
Code: GLBasic [Select]
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)  {
    if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
        // do something on back.
        return true;
    }

    return super.onKeyDown(keyCode, event);
}
Title: Re: Android - Beta SDK
Post by: spacefractal on 2011-May-14
Multitouch on Android also fuzzy too, I found there is axisflips issues on many devices as well. So even its support it, you might been aware of that issue, something like this:
http://www.youtube.com/watch?v=qzhUzq6bTPg&feature=player_embedded

Also its is possible to checkout the screen destiny too (using platform info)?

Also is Android 2.2.x still required (even I would want to see a alternative 2.1.x too, since around 24% still use it and still release phones with that version). I'm not interesed on 1.X

PS. I have not read all pages, where is the minimum requirements really now (I gonna to read most of them now)?
Title: Re: Android - Beta SDK
Post by: spacefractal on 2011-May-14
Also its would been sweet to set a 0x0 as resolution in the option, who means the startup window would use the user desktop resolution, or eventuelly just start as a hidden window.

This should work wonderful on Android (as well all other systems), so you seamless can use that resolution, detected by GETDESKTOPSIZE, without showing a awfull white window first.

My (still early) project is a landscape only game, but dedicated to support rotation, even GETDESKTOPSIZE might return a portrait mode (then its would just rotate 90 degree).

Here CreateScreen is a awesome to use for auto rotation.

Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-14
One thing I did forget to mention is that when changing Platforms in the Project Options window, the default resolution doesn't change when the platform is changed, so you can end up with 640x480 on the Palm :)

[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: spacefractal on 2011-May-14
hm.. its does change nicely here in that part? spooky.

Howover I would like to disable it and just use SETSCREEN set from GETDESKTOPSIZE, also in this case I have programmed my game with all scaling, resize and rotating by myself.

PS. I have tried to use console program, but its does crash out or do nothing.

PPS. Sorry if its offtype, so fell free to move it.
Title: Re: Android - Beta SDK
Post by: Moebius on 2011-May-15
has anyone checked the use of accelerometer yet on their device?  I'm having problems with them being rounded off and I was wondering if this is just my device or if it might be buried somewhere on GLB's side.
Title: Re: Android - Beta SDK
Post by: freedomdown on 2011-May-15
I noticed that Pandora compiling is weird now.
It still talks about running the PandoraMake script on a pandora but then does compile it anyway.
And it compiles it as "pandora-exe.pnd" instead of "projectName.pandora-exe.pnd"
It does still work though so nothing major is broken probably a piece of the older compiling script got left in.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-15
Its probably left over from when the PC had to do part of it and the machine the other part...
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-19
Another hotfix. It should fix the bug on WebOS, where SPRITE2MEM crashed.
This *might* fix the problems with SPRCOLL we had on 1.4.5 - can someone test this, please?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-19
Works on 2.0.  Did you stay with the "load as a power of 2 then truncate" or use glPixelStorei  ?
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-19
load and truncate - to be safe.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-19
Seems to be working fine - going to try Windows CE and Android now...

Windows CE seems fine :)

Android is almost fine, although it crashes out when either loading or using SPRITE2MEM on BMP files (dont know which - most likely the loading :) )
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-19
Another hotfix. It should fix the bug on WebOS, where SPRITE2MEM crashed.
This *might* fix the problems with SPRCOLL we had on 1.4.5 - can someone test this, please?

hotfix?
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-19
Yes, see first post in this thread.
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-19
Another hotfix. It should fix the bug on WebOS, where SPRITE2MEM crashed.
This *might* fix the problems with SPRCOLL we had on 1.4.5 - can someone test this, please?

Tested latest hotfix with WebOS 1.4.5.
SPRCOLL still not working right.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-19
Thats a shame - it had looked like the problem had been found... :'(
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-20
@Millerszone: Can you make a 4x4 sprite, that has alpha information, and use SPRITE2MEM to get the sprite pixels on 1.4.5 and then post the output of the 4 pixel values and the image here?

Also, what size is your real transparent sprite?
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-21
@Millerszone: Can you make a 4x4 sprite, that has alpha information, and use SPRITE2MEM to get the sprite pixels on 1.4.5 and then post the output of the 4 pixel values and the image here?

Also, what size is your real transparent sprite?

The "bat resting" sprite with transparency is 86x90.

Don't understand first question. Someone please leave code.
Title: Re: Android - Beta SDK
Post by: Moebius on 2011-May-21
Something like this:
Code: GLBasic [Select]
LOADSPRITE "4by4.png", 0
LOCAL Pixels%[]
SPRITE2MEM(Pixels[],0)
FOR Offset = 0 TO 15
        PRINT REPLACE$(SOCK_GETIP$(Pixels[Offset]),".",", "), 10, 10
        SHOWSCREEN
        KEYWAIT
NEXT
END

[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-21
I am using this code and image.

Code: GLBasic [Select]
LOCAL data%[]
LOCAL loop%

LOADSPRITE "Media/4x4.png",0
IF SPRITE2MEM(data%[],0)
        FOREACH loop% IN data%[]
                DEBUG "Value : "+loop%+"\n"
        NEXT
ELSE
        DEBUG "Error\n"
ENDIF

On Windows, I get :

Quote
Value : -1531392
Value : -1
Value : -1531392
Value : -1
Value : -1
Value : -1531392
Value : -1
Value : -1531392
Value : -1531392
Value : -1
Value : -1531392
Value : -1
Value : -1
Value : -1531392
Value : -1
Value : -1531392

Now to modify it slight for Palm - the results are in the other picture


[attachment deleted by admin]
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-21
Using MrTAToad code, I get the same values as you do in Windows,
but on my Palm Pre with 1.4.5 I get:

Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Title: Re: Android - Beta SDK
Post by: quangdx on 2011-May-22
I managed to get an older project to compile and create an APK file for me to run on an android device.
But when I try to compile 8BitB.Ob it comes up with the following error.
Code: GLBasic [Select]
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:6525c6b7 - 3D, NET
Wordcount:1349 commands
compile+link:
BUILDSRIPT

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 2 seconds
Android=C:\Dropbox\GLBasic\8BitBob\android
success
_______________________________________
*** Finished ***
Elapsed: 12.8 sec. Time: 22:25
Build: 1 succeeded.

Also I found the program that did compile to be running very sluggishly,
even though it's only setup to run at 30fps using a few sprites.
This was tested on a new Samsung Galaxy S II.

Title: Re: Android - Beta SDK
Post by: quangdx on 2011-May-23
Also I found the program that did compile to be running very sluggishly,
even though it's only setup to run at 30fps using a few sprites.
This was tested on a new Samsung Galaxy S II.

Also tested on a HTC wildfire,
found that the it ran incredibly slowly on that.
Wonder if it's anything to do with it being in debug mode?
An interested  thing, it scaled on both devices, 480x800 and 320x240 automatically.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-23
Quote
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.
Sounds like the android icon isn't present.
Title: Re: Android - Beta SDK
Post by: quangdx on 2011-May-23
Quote
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.
Sounds like the android icon isn't present.

I'm not sure how that would be the case,
as my older program compiled fine, and in both instances I've not created an icon yet,
they both use the standard GLBasic icon.
I even created a new project and copy pasted the source code over and got the same error.
I wonder if it's a command or something, but unfortunately I have no idea what error 384 refers to,
and no idea how to "see the compiler error output for details"
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-23
384 is to do with spaces - do you have any in the project name or path?  Are you using the latest hotfix?
Title: Re: Android - Beta SDK
Post by: quangdx on 2011-May-23
384 is to do with spaces - do you have any in the project name or path?  Are you using the latest hotfix?

I downloaded and installed the latest fix,
and as you can see by the output text, there are no spaces in the project name
Code: GLBasic [Select]
Android=C:\Dropbox\GLBasic\8BitBob\android
I wonder if it's because it starts with a number?

Just copied the code into a new project
EightBitBob and it works fine, so it looks like starting your project name with a number will cause a 384 error.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-23
Quote
PRINT REPLACE$(SOCK_GETIP$(Pixels[Offset]),".",", "), 10, 10

 :-* WINS A PRICE!
Title: Re: Android - Beta SDK
Post by: Moebius on 2011-May-23
I'll take that as a complement  :enc:

Just got to trying the new hotfix, and pausing almost works.  There seems to be a some sort of problem with input.  I'm testing on a Samsung Galaxy S (running an unofficial Android version - 2.3.2).

When I 'pause' the app, by standby-ing the phone switching apps or pressing the 'home' button, the app stays open.  Looking at the debug log using adb, it appears that GLB_ON_PAUSE is called, but GLB_ON_RESUME isnt called.  The same is true using the emulator.

After returning to it, no input is recognised by the GLB app, although it continues to execute just fine.  This also stops my phone from giving vibration feedback when the back and menu buttons are pressed (if that helps somehow), delaying the feedback until I leave the app.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-23
Quote
so it looks like starting your project name with a number will cause a 384 error.
Bit limiting, what with not liking spaces and all :)

Quote
WINS A PRICE!
heh
Title: Re: Android - Beta SDK
Post by: spicypixel on 2011-May-24
I've just compiled my project successfully and have the apk file(s) however I have the command line instructions to install the apk to the emulator

Code: GLBasic [Select]
Add SDK_ROOT to your system variables pointing to /tools folder under the sdk
Run the emulator
Copy the apk file to /tools folder
Change directory to /tools and run from commandline adb install application_name.apk

But I wondered how I do this in Eclipse (1) because it'd be nice to know and (2) because in GLB10 the androidicon is created outside the android folder and as an apk file is already packaged I presumed it needs to be recompiled to include the icon and I'm guessing Eclipse is easier than command line.

Or am I off the mark?
Title: Re: Android - Beta SDK
Post by: Ian Price on 2011-May-24
I don't know about Android, but for WebOS (Palm Pre) the icon is actually included in the packaged file (GLB also  creates a WebOS icon externally) - perhaps Android is the same and doesn't actually use the external icon?
Title: Re: Android - Beta SDK
Post by: spicypixel on 2011-May-24
I don't know about Android, but for WebOS (Palm Pre) the icon is actually included in the packaged file (GLB also  creates a WebOS icon externally) - perhaps Android is the same and doesn't actually use the external icon?

You are indeed right Ian and I now have the apk running on the emulator with the intended icon, which as you say is prebuilt into the package. Just trying to work out now how to import the project into Eclipse so I can export an unsigned apk file and then sign it with my own key. I'd unsign it manually and resign it with my own key in DOS if I knew the commands to unsign =)

It's all good stuff tho, uber pleased.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-24
Help is on hand there then : http://www.glbasic.com/forum/index.php?topic=6169.0
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-27
I notice that even an HTC Wildfire phone, lines and rectangles are just white.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-27
OK, new setup is online.

Clean your project directory manually of everything created. Then build for what platorm you need. There will be a directory "distribute" for non-win,linux platforms that will contain what you need per platform. The "myproject.app/Media" will be copied to the right place as well.

It's the V10 release candidate (though it installs as beta, still). Please feel free to check it out and give some feedback. I think it's pretty useable for all supported platforms now.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-27
We'll give it a good thrashing!

Android compiling is working, but :

Code: GLBasic [Select]
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:47ccc3f7 - 3D, NET
Wordcount:20 commands
compile+link:
BUILDSRIPT
Buildfile: C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\build.xml
    [setup] Android SDK Tools Revision 10
    [setup] Project Target: Android 2.2
    [setup] API level: 8
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]
    [setup]
    [setup] Importing rules file: tools\ant\main_rules.xml

-debug-obfuscation-check:

-set-debug-mode:

-compile-tested-if-test:

-pre-build:

-dirs:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\gen
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\classes

-aidl:
     [echo] Compiling aidl files into Java classes...

-renderscript:
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...

-pre-compile:

compile:
    [javac] Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 2 source files to C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\classes

-post-compile:

-obfuscate:

-dex:
     [echo] Converting compiled files and external libraries into C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\classes.dex...
    [apply] ***** GF: SKIP check the parameter *****

-package-resources:
     [echo] Packaging resources
     [aapt] Creating full resource package...
 [aapt.exe] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.

-package-debug-sign:
[apkbuilder] Creating glbasic-debug-unaligned.apk and signing it with a debug key...

debug:
     [echo] Running zip align on final apk...
     [echo] Debug Package: C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\glbasic-debug.apk

BUILD SUCCESSFUL
Total time: 5 seconds
     [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...
    [javac] Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
     [echo] Converting compiled files and external libraries into C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\classes.dex...
     [echo] Packaging resources
     [echo] Running zip align on final apk...
     [echo] Debug Package: C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\glbasic-debug.apk
     [echo] Installing C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android\bin\glbasic-debug.apk onto default emulator or device...

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

Total time: 9 seconds
Android=C:\Users\Nicholas\Documents\GLBasic\GLBasic\Test1\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 18.8 sec. Time: 22:23
Build: 1 succeeded.

I presume its trying to force installation onto the device, and when it can't it comes up with the error (the apk files are created).

In addition, adb.exe doesn't quit, preventing Clean Project from working (as the files are locked).
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-28
Yes. It's trying to install. You get one [BUOLD SUCCEEDED] and one [BUILD FAILED] for the install.
Can anyone tell me how to kill adb (except the hard way?)
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-28
Will calling "adb.exe kill-server" be sufficient ?

Like the distribute folder, by the way!

Had to change my apk packaging routine for webOS to :

Code: GLBasic [Select]
CALL "%GLB_MAIN_PATH%\compiler\platform\webos\tool\bin\glb_pack_and_install.bat" "%GLB_PROJ_PATH%\distribute\WebOS\%GLB_PROJ_NAME%"
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-28
Still not getting any multi touch on my HTC Desire.
Happy to send code if it will help.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-28
Does the Desire render Drawrect and Drawline in colour??
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-May-29
@MrTAToad
Yes, I have just tried. It draws both the rectangle and line in the correct colour.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-29
Looks like I got the wrong device then :)  Ah well...  :P
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-29
I have had the odd occasion where, after installing, the Andoid application immediately crashes.  Running the program again and its all okay.  The Android Multi-touch program did this, for some reason...
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-29
MOUSESTATE seems to detect a spurious locations every so often, for some reason...
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-29
Since I have my games all updated for iPhone, iPad and Palm I'm now ready to
Start moving them to Android platform.

I started with "Just Pong", so far it looks like everything is working o.k., but there are a
couple of problems. First I'm testing on a Galaxy Tab, screen has a resolution of 1024x600
and the game has a resolution of 480x320 so on the Tab the game is not centered. So my
Question is, is there any way to center the game on different screen resolutions or scale to
fit?
The other problem is that the audio has a delay, but I think that's Androids problem.



Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-29
See the second page of this post - the one by Dabz near the bottom (the bit about XML).
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-29
See the second page of this post - the one by Dabz near the bottom (the bit about XML).
I changed the AndroidManifest.xml to these settings, now game is in the center of the screen.
Thank you.
Code: GLBasic [Select]
<supports-screens android:resizeable="false"
                                  android:smallScreens="false"
                                  android:normalScreens="true"
                                  android:largeScreens="false"
                                  android:anyDensity="false" />
 


Also noticed multi-touch is not working in two player mode.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-30
I dont think multi-touch works on Android

Had the Editor completely hang on me today, after multiple compiles for webOS.  Task Manager says its running, but its completely unresponsive (including minimise and close)...
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-30
I dont think multi-touch works on Android

Hmmmm... that's not good.
I have a couple of Android games that are Multi-touch, so maybe GLBasic will add this feature.
I understand that some Android devices don't handle Multi-touch.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-30
I'll try to implement that. Not hard I think.
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-30
I'll try to implement that. Not hard I think.
Thank you.

Also it seems USEASBMP doesn't work with Android. Does that need to be fixed or not compatible with Android.
LOADBMP does work.

I only used it twice, so I can work around it.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-31
Can you test GRABSPRITE instead?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-31
Having a bit of trouble with current projects compiling with Android.  Whilst the androidicon.png is present in the project and res/drawable directory, the compiler keeps saying :

Quote
C:\Users\Nicholas\Documents\GLBasic\Utilities\VectorEditor\distribute\Android\AndroidManifest.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon').
Title: Re: Android - Beta SDK
Post by: Gary on 2011-May-31
not android related but v10 related

running a full screen program on pc using 2 monitors at 1024*1536 resolution and after start up im running a small dos program. Everything sets up, runs the dos program, returns back to the GLBasic program but the computer refuses to set the focus to the program and no mouse or keyboard inputs are accepted. Compile the program with no changes on 9.040 and it works and gives the focus back to the GL program after you click anywhere on the screen
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-31
Having a bit of trouble with current projects compiling with Android.  Whilst the androidicon.png is present in the project and res/drawable directory, the compiler keeps saying :

Quote
C:\Users\Nicholas\Documents\GLBasic\Utilities\VectorEditor\distribute\Android\AndroidManifest.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon').

I had that error. I had to add the icon.png to this folder:
\distribute\Android\res\drawable\icon.png

Icon.png should also be in your root project folder.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-31
But.. isn't the icon copied there?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-31
There is an androidicon.png in the project directory - and it is copied around.  Sounds like its not named correcty...
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-31
But.. isn't the icon copied there?

It was there, but I deleted the distribute folder and when I recompiled it didn't add the icon to the drawable folder.
It's now working correctly.

Yes the icon should be named icon.png
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-31
Yes, that fixed it.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-May-31
Dont think NETWEBEND works on Android
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-31
Can you test GRABSPRITE instead?

GRABSPRITE not working.
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-May-31
GRABSPRITE -all righty. That's a big issue, though! Is it the emulator or a real device?

I copy the icon to:
android+"\res\drawable\icon.png"
where "android" is the directory where the Manifest.xml is inside.
Title: Re: Android - Beta SDK
Post by: Millerszone on 2011-May-31
GRABSPRITE -all righty. That's a big issue, though! Is it the emulator or a real device?

I copy the icon to:
android+"\res\drawable\icon.png"
where "android" is the directory where the Manifest.xml is inside.
Real device. Galaxy Tab
Title: Re: Android - Beta SDK
Post by: 404 Not Found on 2011-Jun-02
Some bugs I found in the latest Android build:
- The app still segfaults on exit (i.e. pressing back key)
- Backgrounding the app is buggy: If the app gets killed by the system, everything is fine; if it's still running, the screen shows but it doesn't respond after re-opening
- Pressing "x" on the hardware keyboard exits the app
- Portrait orientation is somehow hardwired, if you want to make a landscape app, you have to (1) select landscape mode in the manifest file to get the right d-pad directions and (2) select a portrait (!) screen resolution in GLB

Does GLB_ON_QUIT already work on Android?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-06
In addition, I think BMP files crash the running program.
X_LINE and/or X_DOT may not be working
GETJOYX and GETJOY seem to be returning data from the wrong direction : Horizontal movement affects the vertical value and vice versa
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Jun-07
I need help with Andoid, since my device is ..ahem.
Can you set orientation to 0 and hold the device like a phone and then print the JX, Jy, JZ values?

Then, turn the device to lay on it's left side -> again JX, JY, JZ values?
Now, hold it as a phone and slowly tilt it backwards. What values do you get now?


On a Pre/iOS you (oughta) get:
 0,-1, 0
-1, 0, 0
 0, 0, -1

Pre confirmed. iOS surely is, too.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-07
I'll see what its like on the Android...

However, my Pre values dont quite match up with on its left side - I get 0, -1, -0.2 (it does fluctuate wildly even what flat!)
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Jun-07
Did you update to 10.012?
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-07
oh yes :)

My Android tablet values are thus (its approximate as it does vary by around +/0.1) :

Starting Orientation 0 :   

-0.2
0
0.1

Turning Left:

0
1
0

Turning Right :

0.2
0
1

Backwards

0
0
1

Forwards :

0
0
-1

I'll have to try the phone when its been charged...
Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Jun-07
The tablet values (as on mine) seem pretty broken. Right+Backwards look almost the same. Starting orientation has a vector of (0.2^2+0.1^2)^.5 = 0.224. That's 1/4 of the earth's gravity (moon?)

Either there's a really bad bug in my code, or these tablets are "not so good" when it comes to orientation and gravity sensors.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-07
Got a feeling the results will be the same with the phone...

Will soon know :)
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-07
Its completely different for the phone :

Should be:
Code: GLBasic [Select]
 0,-1, 0  upright
-1, 0, 0  to the left
 0, 0, -1  to the back
 

Is:
Code: GLBasic [Select]
0,1,0  upright
1,0,0  to the left
-1,0,0 to the right
0,0,1  back
0,0,-1 forward
 


Changing orientation produces the same values (which is good :) ).  And there is no jittering either...

Again, Chinese tablets prove to be pretty worthless...

[edit] sorry for realigning.

Title: Re: Android - Beta SDK
Post by: Kitty Hello on 2011-Jun-07
Ah, I think I just have to make them all negative then. Pretty easy. Phew XD.

What device was that, again? I'll make that the reference then :D
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-07
HTC Wildfire !  Its the one that cant render rectangles in colour...

And is slow...
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-Jun-15
Trying to update from 10.001 but it keeps crashing on the web update.

Is there anywhere I can download the file and apply it like the hotfixes?

This is on Windows 7 x64.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-15
The update.exe update should be either on the first page of this post or somewhere in the General one...
Title: Re: Android - Beta SDK
Post by: matty47 on 2011-Jun-15
Just to confirm that the live update crashes on Win 7 Home Prem. I downloaded the install from post one again, however this is still version 10.001. When I do a web update it tells me version 10.013 is available so I say update. Update runs and lists what it is doing eg read info file etc. When it gets to "Installing Update", it crashes and closes with no further messages except Windows message saying that the program has stopped working.
Title: Re: Android - Beta SDK
Post by: MrTAToad on 2011-Jun-15
In that case use : http://www.glbasic.com/forum/index.php?topic=6440.0
Title: Re: Android - Beta SDK
Post by: BigAnd on 2011-Jun-16
Cheers for that MrTAToad and cheers Kitty for the fix  =D
Title: Re: Android - V10 release candidate
Post by: bigsofty on 2011-Jun-28
How stable is this release, anyone tried it a largish project? I don't see anyone complaining lately, which is a good sign.
Title: Re: Android - V10 release candidate
Post by: Crivens on 2011-Jun-28
I was going to ask that. I've been avoiding it and the latext XCode just incase I have problem. If people are getting stuff onto the app store with it then I think I'll upgrade. Or does anyone have a good idea of when it should be released?

Cheers
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jun-28
I released my Spots demo - I've had as of today 17 total installs and 6 active installs and no comments or rating  Its been available for 2/3 weeks now.

Contrast that with 4373 downloads for webOS, with most people disliking the graphics (or somehow finding it hard to navigate  :blink: ).  However, with the help of Erico (who is kind enough to be re-doing the graphics), I'm hoping the next version will fair better...
Title: Re: Android - V10 release candidate
Post by: bigsofty on 2011-Jun-28
Ah cool, its feels quite stable, no bother with my rather large project, even my amateurish inline C gubbins all worked fine. The only problem was the update seemed broken but I found your link fixing that MrT.   :good:
Title: Re: Android - V10 release candidate
Post by: felix330 on 2011-Jul-01
if I try to compile for Android I get 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"
But how do I set the environment variable? I have tried: "GLOBAL JAVA_HOME  = "C:\Programme\Java\jdk1.6.0_26"" , but it still won't work.
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-01
The JAVA_HOME should be set in Windows Environment Section
Title: Re: Android - V10 release candidate
Post by: felix330 on 2011-Jul-01
Found it, thanks! :)
EDIT: Is it also possible to install the APK on a virtual Android machine? I don't have an Android device to test it on.
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-01
Yes. Just install the SDK and run the emulator. The uploading is done by GLBasic.
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-07
NETWEBEND doesn't seem to be working on Android...
Title: Re: Android - V10 release candidate
Post by: mentalthink on 2011-Jul-09
Hi I like to have multitouch active in Android, if not it´s a hard job.

Iván J
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-11
It's on the ToDo list. My device should be able to deal with it now, so I can test it.
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-11
I've noticed that GLB copies all the media files (a necessary step).  After the first run everything loads quickly, but the user is left looking at a blank screen with the app name for a very long time on the first run, and it would be great if instead of a blank screen there was a splash screen...

Fiddling around with SDLActivity.java, setContentView() can be used for views defined in the layout xml files (making it easy to create a splash screen using graphics in the "drawable" folder).  However, the view that's been set doesn't become visible until after everything is initialised - at least until after onCreate(), onStart(), and onResume(), ruling out putting the copyAssets() call in one of them...

Is displaying a splash screen possible?  The two ways it could be done seem to be: getting a view to be displayed during initialisation - which from I can tell isn't possible, or calling copyAssets() just before GLB code, after initialisation.
If that can be called, setContentView(mSurface) could be put in copyAssets() (or a better named function) so that the splash screen is displayed right up until everything is copied and GLBasic code is reached...

The second option doesn't seem possible to me either as the compiler complains if copyAssets (and the other copy/delete functions) are declared as static...

Anyway is it possible?  I can't get any further with my understanding and with the code I have access to.  :giveup:  Any ideas?
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-11
OK, I think a splash screen should be possible. I will think about a way to display it and what about different screen sizes?
Phew.
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-11
All programs seem to have a long time on the black screen - however, all mine are slow machines.
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-11
If it's possible to use an ImageView, I think that takes care of the scaling automatically.  If method 2 (delaying the copyAssets() call) works, an xml and another setContentView() should do the job.
Title: Re: Android - Beta SDK
Post by: KermEd on 2011-Jul-16
384 is to do with spaces - do you have any in the project name or path?  Are you using the latest hotfix?

I downloaded and installed the latest fix,
and as you can see by the output text, there are no spaces in the project name
Code: GLBasic [Select]
Android=C:\Dropbox\GLBasic\8BitBob\android
I wonder if it's because it starts with a number?

Just copied the code into a new project
EightBitBob and it works fine, so it looks like starting your project name with a number will cause a 384 error.


Nice find!  It was failing for me with a number in the name anywhere with that error.

I tried  the number at the start, middle and end.  It seems to be the path containing a number not just the project name.

Cheers!
Title: Re: Android - V10 release candidate
Post by: okee on 2011-Jul-16
Having problems myself, keep getting error :


Code: GLBasic [Select]
BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 1 second
Android=C:\adveng\distribute\Android
success

If i look in the main_rules.xml of glb directory at line 384 it's
classpathref="jar.libs.ref">

no idea what it references to though.


I'm using GLB 10.051, XP SP3, java_home is set.
Project is in  c:\adveng   no spaces etc

Thanks


okee
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-16
Code: GLBasic [Select]
Yes, Adroid is failing :

[code[
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:47ccc3f7 - 3D, NET
Wordcount:21 commands
compile+link:
BUILDSRIPT
Buildfile: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\build.xml
    [setup] Android SDK Tools Revision 10
    [setup] Project Target: Android 2.2
    [setup] API level: 8
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]
    [setup]
    [setup] Importing rules file: tools\ant\main_rules.xml

-set-release-mode:
     [echo] *************************************************
     [echo] ****  Android Manifest has debuggable=true   ****
     [echo] **** Doing DEBUG packaging with RELEASE keys ****
     [echo] *************************************************

-release-obfuscation-check:

-pre-build:

-dirs:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\bin
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\gen
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\bin\classes

-aidl:
     [echo] Compiling aidl files into Java classes...

-renderscript:
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...

-pre-compile:

compile:
    [javac] Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 2 source files to C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\bin\classes
    [javac] C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\src\com\glbasic\test\SDLActivity.java:84: cannot find symbol
    [javac] symbol  : variable Configuration
    [javac] location: class org.libsdl.app.SDLActivity
    [javac]             int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
    [javac]                                                                                  ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 3 seconds
     [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...
    [javac] Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\src\com\glbasic\test\SDLActivity.java:84: cannot find symbol
    [javac] symbol  : variable Configuration
    [javac] location: class org.libsdl.app.SDLActivity
    [javac]             int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
    [javac]                                                                                  ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 1 second
Android=C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 14.1 sec. Time: 11:05
Build: 1 succeeded.
 
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-16
Changing that line:
Code: GLBasic [Select]
int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
to this
Code: GLBasic [Select]
int keyboardPresent = (getResources().getConfiguration().keyboard != android.content.res.Configuration.KEYBOARD_NOKEYS) ? 1:0;
works compiles (edit: ok haven't run it)...
(http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS (http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS))

BTW does GLB compile the app twice?
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-16
I dont think so - one is a pre-compile, whilst the second part is the actual compilation...
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-16
That seems right.  Could have sworn I used to see two "BUILDSCRIPT"s in the output...
Anyway it seems Android apps (even Hello World) won't run with 10.051.  It compiles (with the slight addition to SDLActivity.java), installs, and force closes when the app is opening.
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-16
Any idea what is in the Log ?
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-16
Relevant section of the log:
Code: GLBasic [Select]
I/ActivityManager(  132): Start proc com.jamespayor.generaltesting for activity com.jamespayor.generaltesting/org.libsdl.app.SDLActivity: pid=1821 uid=10110 gids={3003}
I/Launcher(  239): onWindowFocusChanged(false)
W/ResourceType(  132): Skipping entry 0x7f040002 in package table 0 because it is not complex!
D/Launcher(  239): It's image wallpaper. suggestDesiredDimensions(-1,-1)
W/ResourceType(  132): Skipping entry 0x7f040003 in package table 0 because it is not complex!
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL.so 0x40512c88
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL_image.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL_image.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libSDL_image.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libmikmod.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libmikmod.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libmikmod.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL_mixer.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL_mixer.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libSDL_mixer.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL_ttf.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL_ttf.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libSDL_ttf.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libmain.so 0x40512c88
W/dalvikvm( 1821): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/libsdl/app/SDLActivity;
W/dalvikvm( 1821): Class init failed in newInstance call (Lorg/libsdl/app/SDLActivity;)
D/AndroidRuntime( 1821): Shutting down VM
W/dalvikvm( 1821): threadid=1: thread exiting with uncaught exception (group=0x40015578)
E/AndroidRuntime( 1821): FATAL EXCEPTION: main
E/AndroidRuntime( 1821): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 1821):        at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 1821):        at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime( 1821):        at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1540)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1642)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 1821):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:932)
E/AndroidRuntime( 1821):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1821):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.main(ActivityThread.java:3651)
E/AndroidRuntime( 1821):        at java.lang.reflect.Method.invokeNative(NativeMethod)
E/AndroidRuntime( 1821):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1821):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
E/AndroidRuntime( 1821):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
E/AndroidRuntime( 1821):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1821): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]:    84 cannot locate 'g_androidKeyboard'...
E/AndroidRuntime( 1821):
E/AndroidRuntime( 1821):        at java.lang.Runtime.loadLibrary(Runtime.java:434)
E/AndroidRuntime( 1821):        at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime( 1821):        at org.libsdl.app.SDLActivity.<clinit>(SDLActivity.java:50)
E/AndroidRuntime( 1821):        ... 15 more
W/ActivityManager(  132):   Force finishing activity com.jamespayor.generaltesting/org.libsdl.app.SDLActivity
E/        (  132): Dumpstate > /data/log/dumpstate_app_com_jamespayor_generaltesting_error

Extremely relevant bits:
- Class init failed in newInstance call
- Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]:    84 cannot locate 'g_androidKeyboard'...

EDIT: Also, replacing the amended line in SDLActivity.java with "int keyboardPresent = 0;" has no effect on the problem, so it's buried somewhere else.
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-16
Sounds like something in the SDL package that should be there isn't :)  Wonder if the minimum Android OS spec. has been updated to 2.3... :blink:
Title: Re: Android - V10 release candidate
Post by: ByteByter on 2011-Jul-16
Changing that line:
Code: GLBasic [Select]
int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
to this
Code: GLBasic [Select]
int keyboardPresent = (getResources().getConfiguration().keyboard != android.content.res.Configuration.KEYBOARD_NOKEYS) ? 1:0;
works compiles (edit: ok haven't run it)...
(http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS (http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS))

BTW does GLB compile the app twice?
This does indeed fix the compiling issue, however the app crashes prior to even executing one line of user code. :(
Also, at least with me, there is no longer an icon for the App once installed...either that or it's a completely transparent Icon  ::)
That seems right.  Could have sworn I used to see two "BUILDSCRIPT"s in the output...
Anyway it seems Android apps (even Hello World) won't run with 10.051.  It compiles (with the slight addition to SDLActivity.java), installs, and force closes when the app is opening.
Indeed I can confirm this, the app crashes while loading.
...Does anyone know if you can roll back to say 10.004 or whatever the last beta was easily?
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-16
Yes, just download the beta again...
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-17
Extracting one of the updater's backups seems to work for reverting as well (see the program files folder).
Title: Re: Android - V10 release candidate
Post by: ByteByter on 2011-Jul-17
Extracting one of the updater's backups seems to work for reverting as well (see the program files folder).
Thanks, this is more of what I was looking for, as I knew Glbasic copied a backup somewhere, I just didn't know where. Thanks :)
Title: Re: Android - V10 release candidate
Post by: KermEd on 2011-Jul-17
Code: GLBasic [Select]
BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 1 second
Android=C:\adveng\distribute\Android
success

I had the same problem.  Try:

1)  pushing your project to: C:\temp\temp instead of C:\adveng\distribute\Android.
2)  make sure you didnt install GLBASIC beta with spaces or brackets in the filename. 
3)  make sure everything is installed on 32bit system - I put mine on a bootcamp Win32 XP SP3 OS.

Now mine compiles and runs.  But it does not install on my 2.3 and earlier Android devices (basically any devices that are unable to run Flash).  2.3 with flash and higher might work.  It just says its an invalid package on those other Android OS's.  Higher versions seem ok though.  I won't know until my testing group gets back to me on the build.

My compiled app is here:

http://filearchivehaven.com/downloads/android/StarsTest.apk

Its a rewrapped version of the Starfield demonstration that comes with GLBASIC.  Basically, it adds colours to the program and allows you to change the direction of the stars by your mouse clicks.

I'm planning on creating the same FPS calculator in GLBASIC, Java (Eclipse), Simple Android Basic, and that easy Android Application maker for comparison with different graphic modes.

Still on my to-do list.

Lloyd
Title: Re: Android - V10 release candidate
Post by: okee on 2011-Jul-17
hi

Quote
1)  pushing your project to: C:\temp\temp instead of C:\adveng\distribute\Android.

How can i do this ?

Quote
2)  make sure you didnt install GLBASIC beta with spaces or brackets in the filename. 
3)  make sure everything is installed on 32bit system - I put mine on a bootcamp Win32 XP SP3 OS.

The path is C:\Program Files\GLBasic_beta and i'm using XP sp3

That StarsTest app runs fine on my 2.2 ZTE Blade (rooted) 


Thanks

okee


Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-17
Oh no - its a problem with this update and not a pathing issue...
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-18
Very strange. With the fix of the java-file, it worked for me. Please press the dump bin icon to rebuild from scratch.
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Jul-18
Didn't notice that button - very helpful.  I have been deleting the 'Android' build folder anyway.
Compiles and runs with 10.042, and with the fix compiles but crashes when starting using 10.051...  Already posted the relevant log.  An unsatisfied link involving "g_keyboard" is mentioned.

Should point out this is on 2.3.2, using a Galaxy S - which has no physical keyboard.
Title: Re: Android - V10 release candidate
Post by: okee on 2011-Jul-18
I hadn't tried to compile for android before 10.051 so didn't know if it worked on  my system
I've removed 10.051 and reinstalled 10.001 and can compile to my Android phone now.
Is there any way to update to 10.042, i'm only offered 10.051 in the ide update.
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-18
Gernot has found the reason, so it might be just worth waiting until the update comes out...
Title: Re: Android - V10 release candidate
Post by: okee on 2011-Jul-18
Yeah, I'm happy enough just to get it running as i thought is was a problem with paths or sdks.
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-18
is out. 10.053
Title: Re: Android - V10 release candidate
Post by: djtoon on 2011-Jul-18
is it out? why dosent glb ask for an update :(
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-18
try again!
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-18
You can set how often you want GLBasic to check for an update at the start. It will be no more than once a day.
You can kick the update with the menu "Web/Internet Update" anytime, though.
Title: Re: Android - V10 release candidate
Post by: okee on 2011-Jul-18
Hi gernot

That's up and running fine now, just 2 things there's no default icon for the app
The other problem is there are 4 new Drives on my computer each drive contains
the contents of the glbasicbeta directory

Update: restarting the computer got rid of them and it doesn't seem to be happening now

For anyone getting the errors
Quote
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:639: The following error occurred while executing this line:
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:271: exec returned: 1
It seems like connectivity issues, you can check the current status of your Android device by typing
adb devices from command prompt, you may have to cd to the following directory before you run the command
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\platform-tools\

It should return

List of Devices Attached
<serial no>   device

if it says device you should be fine anything else you may need to restart your device
if nothing appears it's probably a usb issue

Title: Re: Android - V10 release candidate
Post by: djtoon on 2011-Jul-19
9.040 is the official version out 10V is still beta, yes?
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-19
Indeed - there are a few issues left (well, one that I know of), so it shouldn't be too long...
Title: Re: Android - V10 release candidate
Post by: Gary on 2011-Jul-20
Has anyone tested it with the Sony Xperia Play? Just wondered if the extra buttons can be read easy enough? I am guessing it would be read like a keyboard with the KEY command but just want to check. Because of all this Android talk I have gone and upgraded my iPhone contract early and got myself the Xperia lol, damn you Kitty  :'(
Title: Re: Android - V10 release candidate
Post by: Kitty Hello on 2011-Jul-20
you swapped your iPhone for an Android? I'm not sure if that was a good idea.
Title: Re: Android - V10 release candidate
Post by: Gary on 2011-Jul-20
na, kept the iphone as it was all paid for and out of contract but got an android on contract this time, so best of both worlds, one on monthly contract other on pay as you go :)
Title: Re: Android - V10 release candidate
Post by: spacefractal on 2011-Jul-29
I would just get for a Table.

I have just got Android emulator to run.... but some reason if the app is installed, its never updated under compile, but just show the allready installed one.

I guess its should uninstall, before install?
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Jul-29
Yes, you have to do that...
Title: Re: Android - V10 release candidate
Post by: Minion on 2011-Aug-03
OK, Im stumped. No matter what I do I just cant get the blinking thing to run in 800x480 res ;( The screen res seems to be popping up as 570x 320. Ive tried setting other screen resolutions and they all pop up as 570x320. It works fin on PC. Is there anything Im doing wrong (prolly)
Title: Re: Android - V10 release candidate
Post by: MrTAToad on 2011-Aug-03
Dont think so - I have no problem with setting to the native resolution for my phone.  I believe one of the XML files could be modified to force native mode - unfortunately I can't remember which one.
Title: Re: Android - V10 release candidate
Post by: Quentin on 2011-Aug-03
I had the same problem with my HTC.
Only res 533 x 320 now matter which project settings I used. Even SETSCREEN had no effect.

Then I changed file AndroidManifest.xml in the project directory
Code: GLBasic [Select]
<supports-screens android:resizeable="true"
                                          android:smallScreens="true"
                                          android:normalScreens="true"
                                          android:largeScreens="true"
                                          android:anyDensity="true" />
 
I've change "resizeable" and "anyDensity" to true. After this it works with high resolution 800 x 480, but now I'm not able to set smaller resolutions.

perhaps we have to look closer to:
http://developer.android.com/guide/practices/screens_support.html
Title: Re: Android - V10 release candidate
Post by: Minion on 2011-Aug-03
YaY ;) That works (for now) ;) Lets hope this is a minor tweak that Gernot can do so it sorts it out. At the moment Im happy coding in 800x480 (My pandy stuff will port straight over now ) until its sorted out.
Title: Re: Android - V10 release candidate
Post by: spacefractal on 2011-Aug-07
yes anyDensity="true" should have been true, since this works to get the real device of most device (and yes we might require two build, one for major resolutions and one minor as a fix).

resizeable is not used anymore, and thus i guess false is still should been set.

That which is real missing is there is not possible to detect Density in GlBasic. So that mean its not possible to detect the physical size of the screen, which can been a mobile or tablet.

That should been in the platforminfo$["Density"] and could been great for even iPad too.

That mean scaling buttons could been better and more suitable for a finger size.
Title: Re: Android - V10 release candidate
Post by: ampos on 2011-Aug-27
I can not open a 480x320 screen on my device (800x480), it open the screen like a top-left window, and the things even are drawn outside of my screen (window).

I have tested all the manifiest.xml options with no luck.

I would like it centered in the screen and/or scaled (as iPad does with old games). A scale up option would be great.
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Aug-27
I was thinking of just rendering to a 480x320 sprite, then scaling as necessary, to avoid this without adapting the code to allow many resolutions.
This wouldn't be too difficult to implement...
Title: Re: Android - V10 release candidate
Post by: ampos on 2011-Aug-27
It is not a solution.

GLB seems to be ignoring the screen size in someway.
Title: Re: Android - V10 release candidate
Post by: Moebius on 2011-Aug-27
On my device (also 480x800 Galaxy), the app is scaled up from 480x320 to 720x480.  This means of course that there is an 80 pixel border on the right, but AFAIK the scaling works perfectly (unless you want the game to be borderless, but distorted).