BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   how to check and turn On GPS if off? (http://www.blackberryforums.com/developer-forum/219765-how-check-turn-gps-if-off.html)

imran2k1 02-16-2010 08:58 AM

how to check and turn On GPS if off?
 
Hi all,
my application is reading the Latitude and longitude, it is working fine,
but it is giving exception when the option->Advance Option->GPS->GPS Services "Location off" otherwise when "Location On" then it is woking.

i tried to find the API to turn on, but i did not get, if any body know
how to check either GPS is on or off , and if off then how to On because
without turn on my application will give Exception
please help me.
Thanks and regards
Imran ali

hrbuckley 02-16-2010 11:08 AM

There won't be an API for that. If the user turned off the GPS, why should an application be able to over ride that decision and turn it back on?

Dougsg38p 02-16-2010 11:15 AM

And adding to hrbuckley's post, your code should be expecting this situation and catching the exception.

imran2k1 02-17-2010 12:05 AM

Quote:

Originally Posted by hrbuckley (Post 1565827)
If the user turned off the GPS, why should an application be able to over ride that decision and turn it back on?

Indeed, in my application when the mobile is switch on then at that time it should read the Longitude and latitude and mail it automatically.
i am able to send mail but when i am going to read the position when GPS is already off then it is creating problem.
so, i have to first check either GPS is on or off, if off then turn it on and read the Lon/Lati
therefor, if any one know the API to turn on the GPS then kindly help me.

hrbuckley 02-17-2010 12:44 PM

Third party developer applications can't do this. You will have to tell your users that if they want your program to function correctly location base services have to be turned on.


All times are GMT -5. The time now is 12:12 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.