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
New Contributor
priyankmollati
Posts: 6
Registered: ‎11-16-2012
My Device: 9700
My Carrier: AT&T

Turn on GPS programmatically in blackberry 5.0

can any one please help me in turning on the location services programmatically in 5.0 .

 

my requirement is like its a background service which will track the lat long positions .

even if the user turns of the location services in the gps settings i should be able to turn it ON programmatically

 

Please use plain text.
Trusted Contributor
Davidf65
Posts: 151
Registered: ‎07-20-2010
My Device: Not Specified

Re: Turn on GPS programmatically in blackberry 5.0

Hi, try LocationInfo.isLocationOn(). Don't know if the method is available for OS5. It works for me on OS6 and 7x

Thanks

 

David

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Turn on GPS programmatically in blackberry 5.0

AFAIK, it is not possible to programatically enable the location settings.  You just have to tell the user that they need to enable them. 

Please use plain text.
Trusted Contributor
Davidf65
Posts: 151
Registered: ‎07-20-2010
My Device: Not Specified

Re: Turn on GPS programmatically in blackberry 5.0

sorry for the incomplete post, its actually LocationInfo.setLocationOn()

 

Thanks

 

David

Please use plain text.
New Contributor
priyankmollati
Posts: 6
Registered: ‎11-16-2012
My Device: 9700
My Carrier: AT&T

Re: Turn on GPS programmatically in blackberry 5.0

Hi David thanks for the reply LocationInfo.isLocationOn() is not available in on OS5.

please let me know if there is alternate method.

Please use plain text.
New Contributor
priyankmollati
Posts: 6
Registered: ‎11-16-2012
My Device: 9700
My Carrier: AT&T

Re: Turn on GPS programmatically in blackberry 5.0

Sorry  LocationInfo is not available in OS5.0.

 

Thanks 

Priyank.

Please use plain text.
Developer
mayureshg
Posts: 31
Registered: ‎08-05-2011
My Device: 9550
My Carrier: Vodafone

Re: Turn on GPS programmatically in blackberry 5.0

As 


/*********************************************************************/
Please press the like button on the right side to thank me if my reply helped you and please mark posts as solved if you found a solution.
Please use plain text.
Developer
mayureshg
Posts: 31
Registered: ‎08-05-2011
My Device: 9550
My Carrier: Vodafone

Re: Turn on GPS programmatically in blackberry 5.0

You can well try to direct the user to to Manually turn the GPS on if the GPS is switched off. Like is done in case of say Android or Iphone applications. i.e. try to redirect the user to the turn the GPS ON.


/*********************************************************************/
Please press the like button on the right side to thank me if my reply helped you and please mark posts as solved if you found a solution.
Please use plain text.