Location plugin in android issue

Hi,

I have problem with Location Plugin with android mobile event LocationTrackerOnPositionChanged calles frequently even my android mobile is in steady position it calls the event continuously so my Map redraw in every 5 -10 seconds.

Happens in only android phones not in iphone. 

Please suggest.

Thanks


Hi Shoeb,

I just checked the plugin, in this you are getting time stamp also with location update. So you can compare this time stamp with previous time stamp and if difference is greater than some value then only accept new location other wise reject it.

For second option, you have to make changes in java script of plugin and pass there value of distance, like we do in Android we distance is greater than 10M only then notify about location change.

Thanks.


Vikas Sharma wrote:

Hi Shoeb,

I just checked the plugin, in this you are getting time stamp also with location update. So you can compare this time stamp with previous time stamp and if difference is greater than some value then only accept new location other wise reject it.

For second option, you have to make changes in java script of plugin and pass there value of distance, like we do in Android we distance is greater than 10M only then notify about location change.

Thanks.



Hi Vikas,

Thanks for response.

Timestamp is different every time when request comes. and i have checked distance already but as per requirement i m not getting desire results.


Regards,

Shoeb 


Hi Shoeb,

Yes timestamp will be different each time. You have to compare current and last time stamp and if difference is greater than your minimum value then only accept new location update.

Thanks.

Hi Shoeb,

GPS accuracy is one of the biggest myth's out there because of the good job done in hiding these inaccuracies by your car navigation systems.  Watch your GPS navigator how it keeps you on the expected road even though you are gradually getting further and further away from it.  Then suddenly it jumps to where you really are.

That's what Vikas was explaining.  You need to ignore changes below a certain amount from your expected position (say 10 to 15m).  Only once this is exceeded you can refresh your screen.  It depends on your particular application requirements how you deal with small changes but you can bet your average mobile phone GPS will happily jitter around +-10m and often way more.  You can also try use an average error (taken  over say 5 or 10 seconds) to allow refreshing to show smaller changes.

Good luck.  GPS has many hidden gotchas!

Lester Hanger wrote:

Hi Shoeb,

GPS accuracy is one of the biggest myth's out there because of the good job done in hiding these inaccuracies by your car navigation systems.  Watch your GPS navigator how it keeps you on the expected road even though you are gradually getting further and further away from it.  Then suddenly it jumps to where you really are.

That's what Vikas was explaining.  You need to ignore changes below a certain amount from your expected position (say 10 to 15m).  Only once this is exceeded you can refresh your screen.  It depends on your particular application requirements how you deal with small changes but you can bet your average mobile phone GPS will happily jitter around +-10m and often way more.  You can also try use an average error (taken  over say 5 or 10 seconds) to allow refreshing to show smaller changes.

Good luck.  GPS has many hidden gotchas!


Hi Lester,

Thanks for reply but actually i m already using the same logic in my application as Vikas mentioned earlier i am checking distance from current location by 0.1 miles then only updating map. 

but as there is some specific requirement that i need to fulfill. i m trying to find some workaround or putting some application logic to handle this scenario.


Thanks for your time.

Shoeb


Hi Shoeb,

GPS give variation in locations even your device is still. For that either you can compare previous and current locations or time stamp.

But if it not works for you, then I will suggest instead of drawing map again, only change the position of marker on the same map, not reload or refresh the map again and again.

Thanks.