Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: GPS robustness in BB device

Tnx man' So, cool.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPS robustness in BB device

You set:

 

locationProvider.setLocationListener(this, 2, 1, -1);

 

My understanding is as follows:

 

This will wait to provide a location to the listener until the GPS chip has supplied a location which it will pass on, and then try to give you a another location every 2 seconds. 

 

If there is no location available after a 2 second interval, the listener will wait 1 further second for a fix, before giving up - by giving up, this means supplying the listener with an invalid location (so the listener will get bumped every 3 seconds at worst, but the bump might be invalid.  But see next,

 

The maxage, is the maximum age of a location that will be supplied.  The Listener is allowed to reuse a Location it has previously supplied until maxage has passed.  This allows the Listener processing to leave the GPS Receiver 'off' and not ask it for a new value when it doesn't need to.  So the location you are supplied with could, in fact, be the same location that you were supplied with last time. 

 

Does this help?