Answered by:
Need clarifications concerning GPS access via the HTML5 API, or an external sensor

Question
-
Hi,
I have an maps app in store and many user complain that it doesn't grab their GPS position, even tho their tablets have a GPS integrated.
To grab the user's position, I used the HTML5 Geolocation API (navigator.geolocation). Is this one only catching network geolocation and not sensors ? Should i use the Geolocation API from WinJS instead to get better results, including results from embedded GPS sensors? This is the API I am not using at the moment: Windows.Devices.Geolocation
http://code.msdn.microsoft.com/windowsapps/Geolocation-2483de66
Also, some users have external Bluetooth GPS that communicate via the COM port (say COM 4). Can I access the informations from these sensors ? I read online that it would also be seen as a USB devices and that thanks to the Windows 8.1 new USB APIs, I would be able to grab the data from this device. Is that possible, and is there any ressource about this techniques?
Thanks a lot for your help,
Fabien
Wednesday, October 16, 2013 10:39 PM
Answers
-
You want to use the Windows.Devices.Geolocation not the HTML 5 version:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.aspx
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, October 17, 2013 1:47 PM
- Marked as answer by Fabien Nicollet Friday, October 18, 2013 7:57 AM
Thursday, October 17, 2013 1:47 PMModerator -
You also want to specify a "DesiredAccuracy" of "High" in order to get GPS data. If you use the default DesiredAccuracy, it will resolve the location using the WiFi/IP-based location provider.
This posting is provided "AS IS" with no warranties, and confers no rights.
- Marked as answer by Fabien Nicollet Friday, October 18, 2013 7:57 AM
Thursday, October 17, 2013 9:56 PM
All replies
-
You want to use the Windows.Devices.Geolocation not the HTML 5 version:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.aspx
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, October 17, 2013 1:47 PM
- Marked as answer by Fabien Nicollet Friday, October 18, 2013 7:57 AM
Thursday, October 17, 2013 1:47 PMModerator -
Hello and thanks for your answer, that's what i thought.
Do you have any indication on the external Bluetooth devices? Are they also used when using the Geolocation API or it is something different?
Thanks,
Fabien
Thursday, October 17, 2013 2:20 PM -
You also want to specify a "DesiredAccuracy" of "High" in order to get GPS data. If you use the default DesiredAccuracy, it will resolve the location using the WiFi/IP-based location provider.
This posting is provided "AS IS" with no warranties, and confers no rights.
- Marked as answer by Fabien Nicollet Friday, October 18, 2013 7:57 AM
Thursday, October 17, 2013 9:56 PM