Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / GPS integration into Tier1 android apps

Author
Message
Space Dream Studios
Competition Prize Winner 2014
9
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 31st Jul 2013 23:17 Edited at: 31st Jul 2013 23:19
Hi, I have the problem that I need to integrate gps functionality into my app, made with AppGameKit Tier1. As everybody knows, the regular functions are not working yet out of the box.

So I contacted Paul and he gave me a rough guide how to realize it. The problem is, that I'm not that experienced in doing JAVA programming, especially integrating functions into classes, using ECLIPSE.

Unfortunately Paul is very busy at the moment
So he suggested to open up a forum thread regarding the subject, that's what I'm doing right now. It would be great if some of the very experienced members could come up with a step by step tutorial, how to integrate GPS funtionality into a Tier1 app made with AGK.

To get the ball rolling, here comes the rough guide, Paul wrote so far regarding the subject:

>GPS on Android
You will need to find a Java example of getting a GPS location, this should be well documented. Next you will need to edit AGKHelper.java by adding your GPS code as functions you can easily use to get the location data you want, for example you could add a function GetLatitude or something, add them to the "public class AGKHelper" section. Now comes the hacking, in order to get your GPS data back into AppGameKit I recommend hijacking some functions you are not using. The video commands look ideal for this, particularly GetVideoPlaying, GetVideoWidth, etc. Find the function GetVideoValue inside AGKHelper.java and modify the switch statement to return your GPS values based on which value you want to return for each function, and clear out any video code in this function. You can then use the AppGameKit video functions to access these values. If you need to do any GPS setup, stick it in the "public static void OnStart( Activity act )" function.


That should be an interesting learning curve may be for others too, I hope

Thanks in advance!!!

Stephan

mr_d
DBPro Tool Maker
12
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 1st Aug 2013 13:41 Edited at: 1st Aug 2013 13:44
Hi Space Dream Studios (Stephan), this sounds interesting....
If I'm understanding what Paul wrote correctly, it doesn't look like you need to know much at all (if anything) about integrating functions into classes, using ECLIPSE or otherwise.
It sounds like that all you need to do is replace the existing code of the functions that you will use as the container with the GPS code for the functions you need - it's like taking a box containing tennis balls (with the label on the outside saying "Tennis Balls"), emptying out all the tennis balls and replacing them with golf balls, but leaving the box marked as "Tennis Balls".
The first thing you need are the golf balls, so it would be a great start if you could find the GPS functions in Java that you need first, and then we can worry about scooping out all the tennis balls and putting your golf balls in the box.

Space Dream Studios
Competition Prize Winner 2014
9
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 1st Aug 2013 13:50 Edited at: 1st Aug 2013 13:54
@DBPro Tool Maker: Thanks for your reply! Yes, the last part should be no problem. But the first part, integration of the JAVA functions into the existing class "public class AGKHelper" makes me a little bit worried

That's what I found/did so far:

I found following GPS example: http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/

I included all the “imports” they where not already present in the AGKhelper.java
Like this:

//GPS import needed *********************
import android.app.Service;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.IBinder;
import android.provider.Settings;
// ************************************

....after the already existing imports.

Then I added the complete “public class GPSTracker extends Service implements LocationListener {“ – class infront of the first class definition in the AGKhelper.java. (But may be that's the wrong approach!?)

But trying to compile it so far brings up numerous error messages...

Space Dream Studios
Competition Prize Winner 2014
9
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 31st Aug 2013 00:51
I still have problems with the GPS integration into my Tier1 ANDROID app...

Could someone help me please with a more clear way and may be a step by step tutorial of how to include GPS functionality into the AGKHelper.java....

THANKS A LOT IN ADVANCE!!!!

Login to post a reply

Server time is: 2019-08-23 14:06:33
Your offset time is: 2019-08-23 14:06:33