08-02-2012 05:53 PM
How accurate is the HTML5 Geolocation? Does this tap into the native SDK, geolocation.h, or does it somehow get the data elsewhere?
Solved! Go to Solution.
08-03-2012 12:51 AM
zedsaid wrote:How accurate is the HTML5 Geolocation? Does this tap into the native SDK, geolocation.h, or does it somehow get the data elsewhere?
The HTML5 Geolocation provides an object of HTML5 Coordinates including the accuracy of the data. From my work with PlayBook the accuracy works after some seconds and the values seem very good, but it needs some time. BB OS5+ I couldn't test yet. On BB10 right now the issue is the response time of the HTML5 Geolocation implementation in WebWorks so I think you can not compare to something else at this time, hopefully the data is better and delivered even faster in the next update. For a test try to build the KitchenSink examples from the BB github repo or try it directly on your device in the browser.
08-03-2012 01:13 AM
Can the geolocation be retrieved without an internet connection?
Also my app automatically says that the user had denied access to geolocation, when I was never even asked! Is there a reason for this?
08-03-2012 01:20 AM
zedsaid wrote:Can the geolocation be retrieved without an internet connection?
Also my app automatically says that the user had denied access to geolocation, when I was never even asked! Is there a reason for this?
HTML5 Geolocation works without an internet connection directly from the hardware+software in the device.
If the config.xml contains the permission
<rim:permissions> <rim:permit>read_geolocation</rim:permit> </rim:permissions>
the user should be asked to allow access when app is installed to the device. You can also allow/deny application permissions afterwards in the Security->Application Permissions system menu (BB10, PlayBook). I do not have any BB OS5+ here for testing, but it shouldn't differ significantly.
08-03-2012 01:29 AM
Thanks! I had a slightly different permissions xml, once fixed, I get the promp asking for permissions.
08-03-2012 01:49 AM
zedsaid wrote:Thanks! I had a slightly different permissions xml, once fixed, I get the promp asking for permissions.
Nice to know. Mark the post answered for others.
Regards.
08-03-2012 09:27 AM
Webworks Geolocation depends of the WebBrowser implementation of geolocation.
BB OS5:
You can only have a GPS, a-GPS or Cell-Id fix. If you have no coverage you cannot have Wifi geolocation.
BB 0S6 and 7, Playbook:
Wifi geolocation is available.
About accuracy:
Have a look at the documentation linked below. You can specify the accuracy and timeout you need.
https://developer.blackberry.com/html5/apis/positi
08-03-2012 11:50 AM
I was just gonna start a thread about this but as there's one already going...
I whipped up something for a social-network project I have in mind yesterday
You can get the signed BAR from http://www.peardox.com/proximiti.bar and side-load onto something PB compatible (i.e. PlayBook or DevAlpha)
It's a very simple app ATM - Google Map with a Marker (that's where you are)
Using the API I get awful accuracy (+/- 140m)
On further reading I discover the importance of the options argument - especially the highAccuracy one
Not had time to deploy a highAccuracy version yet - gotta earn money as well ![]()
I deployed exactly the same app to Droid - equally bad
Yet to do an iOS
The kitchen sink don't do much better
I'll put the apps on my server when I get it more accurate and Kb what I find
08-03-2012 12:15 PM
I worked with PlayBook in the past using
navigator.geolocation.watchPosition(positionCallback, positionErrorCallback, options);
to get ongoing data from the Geolocation API and while this was running awhile the accuracy was always event better or as of the value it was even smaller.
Seems you need some time to get better informations, but even on PlayBook then on BB10 it takes a long time until API function throws some updates, BB10 is >10sec. and with this it is somehow almost useless on BB10.
I know there is a bug report in JIRA, but it takes too long until APIs are updated or implemented to get an app completely done using such API in our use cases.
08-03-2012 12:28 PM
Just been onto the London office and as I suspected options is vital
My contact tells me that, as you suggest, the lag between picking up a sat and reporting it can be ages
I'm waiting for clarification - he works w/e so I expect results sooner rather than later
In the inbetween I'll put proximiti into high accuracy and try some other things I have in mind
Even though my accuracy was +/- 140m proximiti actually put me withing about 20m of my acual location (in a pub with now sky)
I guess that the thing to do is cache readings so that when I walk into the pub it has me really close then looses me but remembers where I just was