Android Devices

Previous topic - Next topic


I have just had a report back that my app failed to work on an Android phone (Samsung Galaxy S II). As I dont have said phone I cant really tell whats wrong. Then I came up with an idea.

What with there being numerous amounts of devices out there, with umpteen various configurations, I thought it might be worth getting together a list of peoples Android devices here, all the flavours we can muster, and then if people are willing we can try each others apps to check for compatabilty.

I have a Sony Ericsson Xperia Arc

If people are willing to take part I can maintain a list here. And if any of us have problems with a particular device (or just want to check it works with some other device) we can get in touch with the relevant people. Sound plausable ?


There is already a Test device Thread, not only about Android:
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64


That link is off limits to some of us (including me).

I really think a better answer is to create a benchmark application that can be run on all devices to test and evaluate all the different kinds of functionality available in GLBasic.  This should probably be considered as a Unit Test of each available GLBasic command grouped by category - Networking, 2D Graphics, 3D Graphics, Performance, etc... If such an application existed, you would be able to download it and run it on various machines and have the results posted.  This would be similar to the SunSpider ( tests that benchmark your Javascript Performance.  Most of these catagories should be easy enough to get a pass/fail grade for a particular device.  Graphics would be a challenge, but could be done with bitmap compares.  I have seen it done before.

The author of GLBasic could also run this before every new version comes out to make sure nothing has been broken, if its not already being done in some other way.

Android and Blackberry (not supported yet, but I am hopeful) have a large number of hardware and screen size configurations.  Without something like a benchmark test, I would think it would be very challenging to maintain good reliability across either of those platforms.  Its much easier to just make sure it works on the iPad, iPhone, iTouch for now, but as the number of generations of those devices increases, that will get more and more difficult as well. 

Something like this could be created by the GLBasic community...  We would need a framework, and then others could take on certain pieces and contribute.

Just a thought I have had rambling around in my head since I first checked out GLBasic.


This is an interesting idea. I imagine seeing the comparative performance of different platforms on a graph and its clear how useful it would be to collate benchmark results. The trouble is the time it would take to code a broad benchmarking tool and keep everything up to date with each new release of GLBasic. Definitely something best done as a community, e.g. several people all put in some test code each it would be real quick to get something up and working.

btw Minon I have a Galaxy S 2 if you me to try your app.


I actually really like this idea. A Compatibility matrix of sorts. Could be really helpful to confirm which devices your game will run on.

Kitty Hello

I have some test routines for the graphics:
Code (glbasic) Select

// --------------------------------- //
// Project: GLBasicEngineTest
// Start: Friday, March 20, 2009
// IDE Version: 6.197

// drawsprite, grabsprite, createscreen
CREATESCREEN 7, 7, 64,64

DRAWRECT 101,1,16,16,RGB(255,255,255)
DRAWRECT 105,5,8,8,RGB(255,0,0)

DRAWLINE 0,150,320,150,RGB(255,0,0)
PRINT "redline", 0,151

GRABSPRITE 0,101,1,16,16 // GRAB 0

// same with screen
DRAWRECT 0,0,16,16,RGB(255,255,255)
DRAWRECT 4,4,8,8,RGB(255,0,0)

// blit both
DRAWRECT 0,50,200,50,RGB(0,255,0)
DRAWSPRITE 0, 0,50; PRINT "grb", 0,64
p1a% = GETPIXEL(1,51); SETPIXEL 1,51, RGB(0,0,255)
p1b% = GETPIXEL(8,58); SETPIXEL 8,58, RGB(0,0,255)

// viewport - getpixel is global
VIEWPORT 100,50,100,100
DRAWSPRITE 1, 0,0; PRINT "scr", 0,14
p2a% = GETPIXEL(101,51); SETPIXEL 1,1, RGB(0,0,255)
p2b% = GETPIXEL(108,58); SETPIXEL 8,8, RGB(0,0,255)
VIEWPORT 0,0,0,0

IF p1a <> RGB(255,255,255)   OR p1a <> p2a
error("solid  grab != on screen")
ELSEIF p2b <> RGB(0,255,0) OR p1b <> p2b
error("transp. grab != on screen")
error("drawsprite [OK]")

// polyvector
STARTPOLY 0, 0 // fan
c% = RGB(255,255,255)
POLYVECTOR 0,0,0,0,c%
POLYVECTOR 0,80,0,16,c%
POLYVECTOR 80,80,16,16,c%
POLYVECTOR 80,0,16,0,c%

STARTPOLY 0, 2 // strip
c% = RGB(255,255,255)
POLYVECTOR 100,0,0,0,c%
POLYVECTOR 100,80,0,16,c%
POLYVECTOR 180,0,16,0,c%
POLYVECTOR 180,80,16,16,c%

STRETCHSPRITE 0, 200, 0, 80,80

IF GETPIXEL(1,1)<>RGB(255,255,255)
error("polyvec 1,1 != white")
ELSEIF GETPIXEL(40,40)<>RGB(0,0,255)
error("polyvec 40,40")
error("polyvector [OK]")


FUNCTION error: msg$
STDOUT msg$+"\n"

VIEWPORT 0,0,0,0
PRINT msg$,0,200


If you run this on various devices, you will get different results, especially on Android, because it's using all sorts of backbuffer access.


Is there anyway to do the equivalent of a Try...Catch block in GLBasic?  maybe with inline code?  This would be useful in a unit test application so that all the code does not have to succeed in order to get some results.

This test code is probably as good a start as anything else.  I think you would take something like this, figure out a way to run it and do a screenshot (again, probably with inline code like and then post the result.  For now, I think just visually comparing the results would be good enough, over time, being able to compare them with a script that runs a tool would be even better.

Ideally this code would be broken down into smaller unit tests, and maybe (dreaming big here) it would write to a log file on the device with each pass/fail so if it just crashed you could retrieve the log and see how far you got before it crashed, or possibly send the logs off to the GLBasic server ( as the test is running so you could see how far it got before it died.

Starting off with something simple like this would be a good exercise, and very useful.


Android devices: Samsung Galaxy Mini Phone (Android 2.3.4), Optus My Tab ZTE V9 Tablet (Android 2.2).
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).


Quote from: turnerb on 2011-Oct-26Is there anyway to do the equivalent of a Try...Catch block in GLBasic?
There's exactly that in GLBasic, TRY and CATCH.


Quote from: Wampus on 2011-Oct-25
btw Minon I have a Galaxy S 2 if you me to try your app.

Hi Wampus. Yes, id be gratefull if you could help. I sent a test app to a friend with the GS2 and it worked fine, so I finished the game off, put it on the market, and what-ya-know, it didn`t work ;( So something between me building the final app and the test version screws up. If I could use you as a "dummy subject" I would be most gratefull ;) I want to build a version that throws up messages at certain points so I can find out where abouts in the code the samsung doesnt like it. If you can help I would be most gratefull.


TRY/CATCH/THROW currently doesn't work on Android - it terminates the program


Is there a location one can look to find out about what is and is not working on various platforms?

I am curious how I would know that try catch causes a quick exit on android if I had not read it here?

It seems like there should be something like release notes for for each build that identifies what commands you can expect to work.

Kitty Hello

There is some stuff in the maunal of "GLBasic internals".