Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - fivesprites

#1
I don't think the GPS code has been updated since I wrote it a long time ago.  However, it should still work correctly, but it does not report the accuracy of the GPS link.

You have access to lat, lon, speed, bearing and altitude.  It's not hard to update AndroidExtras to include the Accuracy.  Unfortunately, I don't have time to do that these days, but Spacefractal may be able to.

Simply add a new function to AndroidGPS.java called getAccuracy and return location.getAccuracy();  Then update SDLActivity.java and add a new entry for "getGPSAccuracy" and return andreoidGPS.getAccuracy().  The final thing to do is add a new function in AndroidExtras.gbas - call it getGPSAccuracy and fire off a JAVACALL as per the other getGPS functions to "("getGPSAccuracy:");

Again, Spacefractal may be able to help more here as I've not looked at the more recent code in a long time.

Note: You won't start getting valid values back from any getGPS... call until a satellite fix has been made. 

//Andy
#2
Hi,

Yes, you can obtain GPS fairly easily using AndroidExtras (please see other forum posts related to this).  The microphone shouldn't be too hard to achieve.  Taking photos is more complicated.  I did implement this using AndroidExtras a long time ago, but never made the code public as I didn't like the way it worked.

As for iOS, I've no idea I'm afraid.

//Andy
#3
Quote from: spacefractal on 2015-Apr-14
nice to hear back again and Android Extras have been expanded greatly :-).

Sound cutoff could actuelly been fixed by length of the sample after the end. Glbasic dosent like very short samples. Here just add silince to the sound. But yes im do uses tSound for all my games as well due stability is better using SoundPool.

Im could have added SoundPool integrated using glbasic official commands, but im do thinks its two different worlds here. So im dont donna do that now.

Same with TMusic, because its will lost the Mod/XM player. Im dont think the path issue was ever fixed in PLAYMUSIC, but adding full path do allways have do the job throught.

Just to mention, Android Extras uses API-19 today, and added various new features since that and have been much more stable now.

We dsoent uses the old Android 2.3 anymore and have moved on. The newest Android Extras might not even run on Android 2.3 anymore, which today using by few procent today (its like iOS4.x, which im also cant support anymore, due 64bit requirements).

Yes - I should have said - thank you Spacefractal for taking the helm and improving Android Extras - you've done a great job :)

//Andy
#4
Apologies for not being around to answer any questions or provide updates.  Life and work are very busy =/

Yes, I created TSound as the sound functionality in GLB was too limiting for my needs (I needed the ability to alter the pitch (rate) of a sound).  I also had problems with latency and where multiple sounds were being used at the same time - it was often the case that some of the sounds didn't play or were cut off short. 

TSound addressed both issues by using a different method of sound playback on Android.  It's not ideal and has the disadvantage that the samples needed to be short or of lower quality (they're all loaded in memory rather than streamed).  You also needed to spread the sounds out across the four available pools to avoid using up the space allocated by Android.

In all honesty, I'm surprised you got them all to work on pool 0, but I guess it depends how many you have, how big they are and if Android has made improvements in this area :)

TMusic was provided because I was totally fed up with the delay when asking GLB PLAYMUSIC to actually start playing a track.  It also took a variable amount of time for it to respond to requests to pause or stop.  TMusic again uses a different approach to PLAYMUSIC and provides greater control of music playback - without the delays.

//Andy


#5
Don't recall how much testing I did when I wrote it, but it should at least allow the full ASCII charset, including spaces.

//Andy
#6
Thought I'd just add a little of my experience with Polyvectors...

I'd originally ignored them - completely - and opted for the standard sprite functions within GLB.  I also used CREATESCREEN/USESCREEN to draw to a fixed resolution and scale to the target device resolution.

The problem here is that create/use is SLOW on mobile devices.  Big time slow.  So, I calculated a scaling function and scaled sprites accordingly.   Still very slow on some devices.

I then decided to invest some time into polyvectors, and oh my - was it worth it!

I now have a single startpoly and endpoly with everything plucked from a single texture atlas - including particles and fonts. The difference was incredible - from 20fps on a nexus 7 to a solid 60fps.  Even on a lowly Galaxy Europa I was getting 50fps+ (from less than 5fps).  Same code on OUYA is running 60fps too with bags of room to spare.

Granted, this is a tile based game with a single 2048x2048 texture atlas and sprites that don't need loads of detail, but there is a lot going on.  Even having multiple texture atlases and a few start/endpoly routines will see a massive improvement.

It really is worth spending time investigating them and building up your own library of polyvector routines. 

//Andy

#7
Hi Chaps,

Apologies for the absence and lack of updates - I've been crazy busy with work lately :(

Enormous thanks to Spacefractal for keeping this little project alive and for all of the additions.

I'll get an update from Alan as to what has changed and I'll make sure that's reflected in the first post.

//Andy
#8
Yep, you should be able to play more than 4 sounds simultaneously.  It's a little complicated, but you basically have four soundpool instances that you can split your sounds across.

Soundpool has memory limitations, so you need to try and keep your sounds small.  If you split them across the instances, then you should be able to trigger multiple sounds multiple times without issue.

I tried to make it clearer in the sample application and the readme.txt, but if you have any questions or need help then just ask :)

//Andy
#9
You'll notice on Android devices that exhibit significant latency that there is little to no latency when using the music player applications.  Hence why I opted to use the mediaplayer as the method to play music in AndroidExtras.  The devices I've tested on show little to no delay when starting to play music.

Android is a pain in the ....

:)

#10
Quote from: diego on 2013-Oct-22
Quote from: MrPlow on 2013-Oct-22
I thought the Audio not working on my Android app was something i was doing wrong...
So there is a bug?
PlayMusic Work fine (with ogg) but PlaySound have a little delay to start .... it's horrible to hear (makes it seem the game is slow) ....  :bed:

I added extra music support to AndroidExtras to work around this.  Music works fine with that :)

//Andy
#11
Sorry chaps - really busy with work at the moment and I'm off on holiday for a few days tomorrow.

Updated link to the latest beta in first post - great work spacefractal and thanks for helping out!  :)

//Andy
#13
Sorry Ian, but I had to pinch your thread title somewhat ;)

Ok, anybody getting a Gamestick?  I'm hoping to add support to AndroidExtras for it as soon as I can find some spare time. 

Any more Android consoles?  NVidia Shield anybody? ;)

//Andy
#14
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
#15
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