views:

644

answers:

1

Hi there. Does anyone know how to programmatically turn off the Blackberry internal GPS receiver?

+1  A: 

The best you can do is inform the system that your program is no longer interested in positions via the LocationListener interface:

locationProvider.setLocationListener(null, -1, -1, -1);

Access to the GPS is managed through JSR 179 which satisfies all location data requests and manages the GPS hardware to provide service.

Richard
Thanks. Do you know how to turn it back on?
Dave
Is there no actual way to turn GPS off however? I am really looking to do this to save battery power so the above solution wouldnt help in this case. Thanks.
Dave
To turn in back on request a location either through a single location request (which will allow it to go off again): locationProvider.getLocation(timeout) or by setting a listener:locationProvieder.setLocationListener(listener, interval, timeout, maxAge)At the application level you can only limit your own program's power consumption. If the user wants to disable the GPS so that no programs can turn it on that can be done through the GPS options page.
Richard