An odd little error GPS_LocationChanged accelerates over time!

netchicken

Active Member
Licensed User
Longtime User
I am nearing the end of a project yet find an odd bug.

Using a simple counter I show each time the GPS locationchanged fires.

The number increase isn't linear over time, it slowly speeds up, counting about 1 per sec to start, then after a couple of hundred counts clicks over at 2 a second, then 4 a second, until the program after about 30 mins to an hour crashes.

If I close the program and restart it it will continue at the same rate preclose unless I flush the RAM before restarting.

Has anyone else experienced this?
On a Samsung Galaxy S2

There are no calls to GPS_LocationChanged from any other part of the program.

Sub GPS_LocationChanged (Loc As Location)
GPSLocationChangedcounter = GPSLocationChangedcounter + 1
activity.Title =" GPS Active " & GPSLocationChangedcounter
 
Last edited:

NJDude

Expert
Licensed User
Longtime User
You have to have a procedural problem somewhere, I've installed it on my EVO 4G and, the location DIDN'T change, but keeps counting, if the location changes then increments like you described, however, if after that the location doesn't change, the counter keep adding whatever was the last value (5, 6 , etc).
 
Last edited:
Upvote 0

netchicken

Active Member
Licensed User
Longtime User
Thanks for your help. Thats odd. I thought the GPS_LocationChanged would be polling the GPS for an update, therefore would work regardless of the change in location. Afterall how does it know that there is a change in location unless its polling the GPS to find such a change? Sometimes it does stop for a while.

I have GPS1.Start(0,0) under Sub Activity_Resume as standard as the examples.

GPS_LocationChanged isn't called from anywhere in the program. ....
 
Last edited:
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Some procedures are automatic, part of the function or feature, in this case GPS, so there's no need to "call" it it will trigger anyway.

What you could do, is to get the Lat and Lon and everytime you get the coordinates if they are different then add your counter.
 
Upvote 0

netchicken

Active Member
Licensed User
Longtime User
OK, thanks for that info, some things are still a black box mystery to me :)

The counter is there to show how often the GPS is polling and as it gets faster it eventually crashes the program. Its the acceleration of the GPS polling thats the problem, and seems so weird. :)
 
Upvote 0
Top