How can we get if the Gps of the phone is enabled or disabled? Can you provide a small code snippet in C# for Windows Mobile 5.0 for detecting if Gps on WinMo is enabled or disabled. I have to use that in my application. If some API gives a bool value in return, so that i can use it for detecting gps on mobile.
Get if Gps settings are enabled or not on windows mobile 5.0
Collapse
X
-
Have a look for WindowsMobile.S amples.Location in the Windows Mobile SDK then turn off GPS (or run it in an emulator) see how that reacts/what data it returns, and that should give you the results you are looking for.
Thanks,
Mark -
I tried running that sample on emulator, but it behaves normally, means it does not show anything to do gps settings. I think its not detecting the phone gps status.
They are just opening the GpsDeviceDriver for receiving gps from the device.
Is this the correct flow? Any other way i can find the gps status of device?Comment
-
Hmm.... so you want to say "No GPS device detected" before trying to initialize it? And have this be different from the device not having any signal? .... hmm.
Not sure, because Windows Mobile have "virtual device manager" or something like that which handles the GPS... and it's there even if the device doesn't have a GPS module, because it can handle data coming from a Bluetooth device too..
I think your best bet would be to look for the gps data for say 2 minutes, then if you havent got any, report this to the user and get them to make sure that the device has GPS, it is enabled, and has a line of sight to the satellites (i.e. outside)Comment
Comment