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
Highlighted
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified
Accepted Solution

Location provider timeout

Hi

 

BlackBerryLocationProvider _locationProvider = (BlackBerryLocationProvider) LocationProvider.getInstance(bbCriteria);

if (_locationProvider != null){
BlackBerryLocation loc = (BlackBerryLocation)_locationProvider.getLocation(45);

}

 

in the above code I have given timout 45 seconds,

my doubt is if gps get location before 45 seconds, will this methods return upon geting location or will it block until 45 seconds

 

I am doubt bcoz I am getting location only after 45 seconds,

If it bloack util 45 seconds, what would be the alternative to return location upon gps gets it

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Location provider timeout

use a location listener
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: Location provider timeout

so this code will bloack until 45 sec if  gps gets location before 45 seconds ?

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Location provider timeout

no, it blocks until the result is available or the timeout is reached.
see the api:
timeout - a timeout value in seconds an application is willing to wait to obtain a location.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter