Android Tutorial GPS tutorial

Status
Not open for further replies.

Kevin L. Johnson

Member
Licensed User
Longtime User
It sounds like a problem on your device. You cannot reset the GPS. There is no API for that. You can try to call GPS.Stop and then GPS.Start. Though it will probably not help in this case.


Ok, Thanks Erel.

I did notice that when I upgraded to KitKat, my "GPS" Icon in the pull-down "Settings" section changed to a "Location" icon. If I turn off "Location" Services prior to re-running the code and let the tutorial code ask the user to enable GPS (via the "Location" services Icon) then everything runs as before. I just don't like the idea of needing to turn off "Location" services every time before running a GPS dependent app. I would like to know if anyone else might be experiencing this.

Thanks
 

GMan

Well-Known Member
Licensed User
Longtime User
I have several App using GPS (also as BT etc.)
SOME Apps Stops the GPS when finishing (GPS.Stop), others not: if a Apps is used i.e. once a day, the Service will be stopped, if the App is used several time the GPS keep running in the background.
At all, the Service is only used if an App needs it.

So you may set it as a Setup- or Option-parameter to let the user decide
 

Kevin L. Johnson

Member
Licensed User
Longtime User
You don't need to disable Location in order to use the GPS. Maybe the location settings are set to low accuracy mode.

In fact, I have been using the 'GPS only' Mode (which is not the 'High Accuracy' Mode and therefore presumably considered 'Low accuracy'). Additionally, the symptom is as follows ... if I don't manually disable "Location" AND let the app prompt the user to enable "GPS" (which is done by enabling "Location") THEN the app takes takes an unusually long time (10 to 15 min) before the GPS data begins streaming.

UPDATE: I've just run my location services in High Accuracy Mode two times in a row and communication with the GPS was picked up almost immediately. I need to run some more tests for now.
 

AndyW999

Member
Licensed User
Longtime User
Hi

I am running the GPS as a service and starting it off with a timer :-

Sub tmrGPS_Tick
GPSService.Start(0, 0) 'Listen to GPS with no filters.
ServiceCounter = 2

End Sub


I then have :-

Sub GPSService_LocationChanged(Location1 As Location)

If ServiceLocation.Accuracy <=16 Then
do stuff...
GPSService.Stop
end if
End Sub


But it does not stop!

Any ideas?
 

AndyW999

Member
Licensed User
Longtime User
Please use [ code ] [ /code ] tags (without spaces) when posting code.

Make sure that you don't call Start multiple times (without calling stop).


You might well be onto something there!

Thanks

Andy.
 

vincentehsu

Member
Licensed User
Longtime User
Dear Sir:
I've download the sourcecode,but when i built up the project and run as acturally mobile device,I can't get the lat and lon data?
 

stefanoxjx

Active Member
Licensed User
Longtime User
Hi guys, I've a strange problem
I'm testing the sample app of this post, but the app returns me wrong coordinates.
It returns me for latitude 45:37,76xxxx and longitude 12:1,68xxxx instead real coordinate 45:62,xxxx / 12:0,2xxxx.
I've tested this app in two different device and have same problem
Anyone have some ideas?
Thanks.
Best regards.

Stefano
 

achtrade

Active Member
Licensed User
Longtime User
Today, the GPS stopped working.

I have an app with GPS and everything was working fine til now, I'm using galaxy s 3 and galaxy tab 3 7.0 without problem and suddenly today they 2 are not working. I'm not getting any error, just lat and long with value 0.

I tried google map and it's working fine, only my app can't find my location. Also, I installed this example and it doesn't get any lat/long, just this msg "Satellites: 16.20 False 159.30xxxxxxxxxxxxxxxxx.5

What's going on ?
 

achtrade

Active Member
Licensed User
Longtime User
Google Maps uses other sources to find the location if GPS is not available.

Are you testing it outdoors?

I'm only using wifi, those devices don't have cellphone service. Is possible that GPS does not work well only with wifi ?. The strange thing is that Google Map App is working fine only with wifi

Note: After left open my app for several minutes, like 5 or 7 minutes, finally the GPS found my location. What can be happening ?
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…