Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
zedsaid
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None
Accepted Solution

How accurate is HTML5 Geolocation? Compared to native geolocation.h?

How accurate is the HTML5 Geolocation?  Does this tap into the native SDK, geolocation.h, or does it somehow get the data elsewhere?

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?


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.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Contributor
zedsaid
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?

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?

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?


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.

 

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Contributor
zedsaid
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?

Thanks! I had a slightly different permissions xml, once fixed, I get the promp asking for permissions.

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?


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.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
Hithredin
Posts: 401
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?

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/positionoptions.html

 

 

 

 

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?

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 :smileyhappy:

 

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




Click the like button if you find my posts useful!
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?

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.

 

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: How accurate is HTML5 Geolocation? Compared to native geolocation.h?

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




Click the like button if you find my posts useful!
Please use plain text.