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
Raiden
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

How to know GPS is turned off ?

[ Edited ]

Hello guys'

 

I want to know whether disabled GPS in BB device.

Can user disable GPS for BB device ? Is it possible to know disabled GPS ?

 

Plz help me guys'

 

Tnx guys'

Message Edited by Raiden on 01-09-2009 01:05 AM
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to know GPS is turned off ?

Check class javax.microedition.location.LocationProvider

 

and method: getState()

 

check the returned value with contstants defined in this class.

 

I think there is no programmatic way to turn the GPS off.

 

Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: How to know GPS is turned off ?

Tnx for your response.

 

I couldn't understand for you what I mean. 

I tried to mean BB device has GPS chip.

is it possible to disable GPS by user ?

if so, how to know it ?

 

Tnx man'

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to know GPS is turned off ?

LocationProvider class can be used to obtain GPS state.

 

AFAIK there is no direct method to turn the GPS off.

 

As an option you can use class net.rim.device.api.gps.GPSSettings and method setPDEInfo and specify incorrect parameters deliberately to set the GPS off.

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

Re: How to know GPS is turned off ?

I think the Original Poster is asking a question about the User of the device, rather than doing anything pragmatically.

 

AFAIK, there is not a way that the user can switch GPS off, like say they can do for Bluetooth.

 

They may be able to control which applications are allowed to use the GPS receiver via the Application Policy.

 

Does this answer the question?

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to know GPS is turned off ?

The forum section is "Java Development", so I supposed the question is about programmatic approach.

 

To turn the GPS off manually - just go to Options--Advanced Options--GPS and turn the GPS services to Location OFF.

 

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

Re: How to know GPS is turned off ?

A reasonable assumption - but he did ask "Can user disable GPS for BB device ? ".

 

Thanks for pointing out the Option.  However I believe it is only available on devices running 4.5 and above. 

Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: How to know GPS is turned off ?

[ Edited ]
Ok. Tnx guys' I got your points'
Message Edited by Raiden on 01-10-2009 12:40 AM
Please use plain text.