Author Topic: Android Extras (Micro Game Consoles/GPS/Keyboard/Audio)  (Read 44557 times)

Offline fivesprites

  • Mr. Polyvector
  • ***
  • Posts: 101
    • View Profile
    • 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
« Last Edit: 2015-Sep-13 by spacefractal »

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4101
    • View Profile
    • Portfolio
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #1 on: 2013-Apr-30 »
Ultra thanks Fivesprites, will check it out. :good:

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2511
    • View Profile
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #2 on: 2013-Apr-30 »
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)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3447
    • View Profile
    • Space Fractal
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #3 on: 2013-Apr-30 »
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!
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline fivesprites

  • Mr. Polyvector
  • ***
  • Posts: 101
    • View Profile
    • FiveSprites
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #4 on: 2013-Apr-30 »
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


Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3447
    • View Profile
    • Space Fractal
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #5 on: 2013-Apr-30 »
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.
« Last Edit: 2013-Apr-30 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #6 on: 2013-Apr-30 »
Nice!

Offline fivesprites

  • Mr. Polyvector
  • ***
  • Posts: 101
    • View Profile
    • FiveSprites
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #7 on: 2013-May-18 »
Minor update provided to support GLBasic Beta V11.414.  Also a couple of extra functions to TMusic.

//Andy

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #8 on: 2013-Jun-22 »
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.

Offline fivesprites

  • Mr. Polyvector
  • ***
  • Posts: 101
    • View Profile
    • FiveSprites
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #9 on: 2013-Jun-24 »
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

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #10 on: 2013-Jun-24 »
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.

Offline fivesprites

  • Mr. Polyvector
  • ***
  • Posts: 101
    • View Profile
    • 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

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2511
    • View Profile
Re: Android Extras (GPS/Keyboard/Audio)
« Reply #12 on: 2013-Jul-29 »

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)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3447
    • View Profile
    • Space Fractal
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).
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline fivesprites

  • Mr. Polyvector
  • ***
  • Posts: 101
    • View Profile
    • 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