Android Extras (Micro Game Consoles/GPS/Keyboard/Audio)

Previous topic - Next topic

fivesprites

Hi All,

I've been working away on a few extra Android utilities and I ended up realising it was a bit dumb to have multiple forum posts - especially when it meant getting people to make the same changes every time.  Eww.

So, I've wrapped everything up into one and I've even written some instructions! (see the ReadMe file)

Download and updates here (its now version 3.0 using sdk 22, Android 5.1):
http://www.glbasic.com/forum/index.php?topic=9644.0

Questions in this thread please (or create your own).




Current Version: AndroidExtras_v1.1
This ONLY supports the new beta v11.414

Changes in v1.1:

- Added new commands to TMusic:
   - getDuration()  - returns the length of the music track currently playing (in milliseconds)
   - getCurrentPosition()  - returns the current position in the playing track (in milliseconds)

- Added support to reload textures on some devices when OpenGL context is lost (please see the sample application for details)

If you want to try out Game Controller support for OUYA/Android then SpaceFractal has implemented the code and integrated it into AndroidExtras.  A beta release is available here:

Current Beta Version: 1.4beta3

https://dl.dropboxusercontent.com/u/3236515/GreedyMouse/AndroidExtras.zip


UPDATED 28th NOVEMBER 2013
http://www.dropbox.com/s/c1s7dxmf4r8806g/AndroidExtras_update.zip

I've not had time to try this out, but if it can be confirmed as working then I'll update this post accordingly.  Thanks again SpaceFractal! :)

Please see the ReadMe.txt file inside the zip for installation instructions.

If you have any questions then fire away.

//Andy

erico

Ultra thanks Fivesprites, will check it out. :good:

bigsofty

Many thanks Andy(and Spacefractal!)  :good:
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

spacefractal

Im checks this one later. Don't forget to fix the orientation issue when only landscape or portrait is required, because the current glbasic don't do that correctly. Hoeover it's allready in code snippet section in the "how to communicate java" thread.

Godus to you five sprites and finally some one did compiled extra features that use it :-). More of that!
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

fivesprites

Thanks chaps.  Will try to keep adding more nifty features as/when I get time!

I'm working on the Camera at the moment, but it's, erm, a nightmare!  I have it working beautifully in a Java Android app - the camera streams the preview to a SurfaceTexture that I then render onto the face of a spinning cube - fun :)

Unfortunately, I've no idea how to do this in GLB yet.  I can set everything up to preview to a SurfaceTexture, but I can't see how I can make that texture available to the GLB app!  This functionality also requires Android API 11 or greater to work.  :giveup:

I think I've also fixed the pause/resume Android issue but won't include that here - I'm hoping to get that to Gernot to include in the next beta release.

I have a few other ideas I might try, but welcome any suggestions/improvements.

Spacefractal - I *think* I've put the orientation fix into the code.  I'd appreciate it if you could check.

//Andy


spacefractal

#5
Im not home yet. But Will check out.

That another why for a sdk 4.x as a new platform :-).

edit: Yes you have included the orientation fix, but not in the gbas code (but in java). Im thinks using functions that way is very cool, unlike what im did (which used one function to call all java functions). This one is much more readable.

Im like that, so well done. You should add the other functions im made into the AndroidExtras.gbas when you have time.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Albert


fivesprites

Minor update provided to support GLBasic Beta V11.414.  Also a couple of extra functions to TMusic.

//Andy

spicypixel

Loving this library and I look forward to the Google Play services :-)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

fivesprites

Thanks!

Unfortunately, I've been pretty busy with work and another project lately.  I will return to this at some point as I think Google Play would be a great addition (I've almost got it working).

The problem is that the version of the Android SDK that ships with GLBasic is too old to support it.  Kitty would ideally need to update the SDK and also include the Google Play services before I can complete this.  It is possible to upgrade the SDK yourself, but the problem is describing the steps necessary for users that aren't familiar with this process.

So, for now I'm waiting for the next GLB beta.

//Andy

spicypixel

I understand. Look forward to this with the new beta then :D
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

fivesprites

SpaceFractal has kindly sent through a beta of Android Extras that he's updated to add preliminary OUYA support and additional controllers.   

I've updated the first post to reflect this. 

//Andy

bigsofty

Quote from: fivesprites on 2013-Jun-24

The problem is that the version of the Android SDK that ships with GLBasic is too old to support it.  Kitty would ideally need to update the SDK and also include the Google Play services before I can complete this.  It is possible to upgrade the SDK yourself, but the problem is describing the steps necessary for users that aren't familiar with this process.


I have my own NDK installed any ways, it would be cool if we could just 'point' GLB towards those files instead of the default ones?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

spacefractal

im have updated both nDK and SDK in the bonus section, which im have updated the Android folder. Howover im did not update the tempateproj folder as im should. There is few updates required to that (mostly actuelly only the manifest file and the SDL files from this thread).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

fivesprites

I think Kitty is looking at a way to remove the Android SDK/NDK entirely as it bulks up the GLBasic download. 

Instead, if you want to develop for Android/OUYA then you'll need to download them separately and then declare their location within the GLB options somewhere.

This is a much better approach as the SDK can be stupidly large.  No idea when he plans to make this change though.

//Andy