GLBasic forum

Main forum => Announcements => Topic started by: fivesprites on 2013-Apr-29

Title: Android Extras
Post by: fivesprites on 2013-Apr-29
Hi All,

For those interested in GLBasic Android development, I've put a small compilation of extras into the Code Snippets section:

http://www.glbasic.com/forum/index.php?topic=9166.0 (http://www.glbasic.com/forum/index.php?topic=9166.0)

This allows you to use GPS, Virtual Keyboard and enhanced audio.

Enjoy :)

//Andy
Title: Re: Android Extras
Post by: spicypixel on 2013-Apr-30
Not had chance to test this yet Andy, but I did read the readme and it looks like a great little library. Wonder what other additions you may add in the future :D
Title: Re: Android Extras
Post by: fivesprites on 2013-Apr-30
Thanks spicypixel!

Trying to get the Camera to work at the moment - but don't hold your hopes on that one - no idea how to make the resulting texture available to GLBasic apps!

Possibilities for the future are camera flash, logcat capture and one I really want to get working: updating assets (your music/sound/images) in real-time :)

Unfortunately... work, kids, no time  :S

//Andy
Title: Re: Android Extras
Post by: Ian Price on 2013-Apr-30
Cheers Andy :)
Title: Re: Android Extras
Post by: spacefractal on 2013-Apr-30
im did a semi automatic assests where assests got updated if the filesize have been changed, so not the whole assests got compied.

Im thinkgs its allready in the code snippet, so just use that and spice that up in a more user friendly mode. Property instead of LOADSPRITE, its could been SPRITELOAD function, which copy a eventuelly assest file first, and then read the file.

The only downside is you need to create the folders by your self, before updatins, else elsewise CopyAssest will go wrong.
Title: Re: Android Extras
Post by: Schranz0r on 2013-May-01
Hmm i can't find the "like-botton" on this forum :(
Title: Re: Android Extras
Post by: Marmor on 2013-May-01
not tested yet but  :good:
Title: Re: Android Extras
Post by: fivesprites on 2013-May-08
Hi All,

Will be providing a small update to AE soon.  Here's what included:

- Fixes for pause/resume (also some extra calls to allow you to determine if textures need reloading on resume - OpenGL context is trashed on some devices like the Galaxy S1 so you need to reload ALL images!)

- Fixed a bug with GPS - it currently always starts when it should only do that when explicitly called to start! DOH!

- Spacefractal has kindly given me some code to add to the Android Extras for copying assets around as well as Google Licensing

Camera support along with better asset management (accessing files from the APK rather than duplicating them on phone storage as part of the install) are also on the to-do list.

Google is also (apparently) working on a GameCentre type thing but I would imagine that it will only be available in new API's.  So, I'm currently working on support for Swarm (http://swarmconnect.com/introduction).  That should at least provide a stop-gap for people that need a similar solution.

//Andy


Title: Re: Android Extras
Post by: spacefractal on 2013-May-08
Last time I'm failed integrate kiip as well ads network. But it's seen we got all fixes correctly, so it more possible as well.

So I'm will return to look on that in some time.

Also make sure, you still can compile to other platforms with minimum effoct. I'm could not acces assets directly, but that one ok did worked nice and could eventuelly delete them with low memory again.

Don't forget add the missing glbasic function for orientation.

But we'll done :-).
Title: Re: Android Extras
Post by: erico on 2013-May-08
This is going really great! :good:
Title: Re: Android Extras
Post by: bigsofty on 2013-May-09
Wow, this is really blossoming into a great little lib, well done!  :good:
Title: Re: Android Extras
Post by: Jonás Perusquía on 2013-May-10
Nice job!
Thank you for all your efforts! :D
Title: Re: Android Extras
Post by: fivesprites on 2013-May-15
Ok, due to the announcement of the new Google Play Services (leaderboards etc), I'm dropping the SwarmConnect stuff and am now implementing the Google API. 

http://googledevelopers.blogspot.co.uk/2013/05/introducing-google-play-game-services.html

It supports all devices from API level 2.2 upwards so should work great without too much worry.

I'll be making a start on this shortly so won't be releasing any new Android Extras for now.  Actually, I may wait until Kitty releases a new GLB beta anyway - so somebody hurry him along please ;)

//Andy
Title: Re: Android Extras
Post by: veketor on 2013-May-18
thanks a lot for that great work, all this makes glbasic a lot better  =D
Title: Re: Android Extras
Post by: bigsofty on 2013-May-18
Sticky please?  :good:
Title: Re: Android Extras
Post by: kanonet on 2013-May-18
Better move it to code snippets (and maybe make it sticky there). Btw maybe we need platform specific sections in code snippets?
Title: Re: Android Extras
Post by: spicypixel on 2013-May-18
Just looking at the code for AndroidExtras.gbas and the sample code I can see we can use music.seekTo(40000) for 40 seconds in but how can we determine a tracks length in milliseconds? Can we have a music.seekLength() or similar pretty please  :nw:

Find attached a simple update to the AndroidExtras.gbas to allow compilation in Windows for testing without having to worry about the Android specific calls.
Title: Re: Android Extras
Post by: Ian Price on 2013-May-18
Moved and stickied :)
Title: Re: Android Extras
Post by: fivesprites on 2013-May-18
Hi Ian,

Don't mean to be a pain, but could you unsticky and move this back to announcements please?  This thread was an announcement for the actual code snippet that already exists in Code Snippets :)

I did the announcement as usually things just kinda get lost in that snippets section!

See: http://www.glbasic.com/forum/index.php?topic=9166.0

//Andy
Title: Re: Android Extras
Post by: Ian Price on 2013-May-18
Aaaaaaannnnnd UNMOVED AND UNSTICKIED! :P
Title: Re: Android Extras
Post by: fivesprites on 2013-May-18
hehe - thanks :D

Title: Re: Android Extras
Post by: fivesprites on 2013-May-18
Quote from: spicypixel on 2013-May-18
Just looking at the code for AndroidExtras.gbas and the sample code I can see we can use music.seekTo(40000) for 40 seconds in but how can we determine a tracks length in milliseconds? Can we have a music.seekLength() or similar pretty please  :nw:

Find attached a simple update to the AndroidExtras.gbas to allow compilation in Windows for testing without having to worry about the Android specific calls.

Thanks for that spicypixel.  I did have a skeleton already set to go for the next version that covered non, android platforms but will take a look over yours too :)

Re: music.seekTo....  I'll add a method so you can determine the length of a music track.  Will match the Android API, so will be called:  music.getDuration()

//Andy
Title: Re: Android Extras
Post by: spicypixel on 2013-May-18
Quote from: fivesprites on 2013-May-18
Thanks for that spicypixel.  I did have a skeleton already set to go for the next version that covered non, android platforms but will take a look over yours too :)

//Andy

Yours will be far superior, trust me mine is clunky :-)
Title: Re: Android Extras
Post by: bigsofty on 2013-May-18
My fault, I should have requested a sticky in the thread with the lib.  :-[
Title: Re: Android Extras
Post by: fivesprites on 2013-May-18
Updated to v1.1.

This is a minor update to support GLBasic Beta V11.414.  Also includes a couple of new functions for TMusic as requested.

Next update will include support for Google Play Services (Leaderboards etc).

//Andy