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

Native Development

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

Location Services - How accurate?

I just spent a few days building a WebWorks app and in the end, realized that geoLocation is very inaccurate, at least for what I need to be doing.

 

I would like to build an Odomter app, and need location updates every few seconds.  Does the native SDK provide better location services than what WebWorks can provide?

 

Using the playbook.

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Location Services - How accurate?

[ Edited ]

They use same underlying hardware, so accuracy is the same. Playbook don't have A-GPS (assisted GPS) and acquirying satellites is somewhat slow, it can take up to 10-15 minutes on open area with no obstacles. Accuracy of location depends very much on number of satellites device can lock on. Try not to cover with hands area right of BB logo, because GPS antenna is there. When device lock on 3 or more stallites, precision can be very accurate, with error margin of only few meters. 

Just have patient and take PB outside, leave it  with up side facing to the sky, on area wih no obstacles , and wait 10-15 minutes. It should get very accurate geolocation.

Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Location Services - How accurate?

The accuracy that I get is acceptable, it is the intervals that I recieve new location updates that is not.  When it takes 30 seconds or 1 minute to get a new update, that isn't acceptable for certain GPS apps.

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Location Services - How accurate?

[ Edited ]

Depends how you register your listener. I don't have actual code here (i'm on work) but if you register listener with update interval (if i recall correctly) 0, you will get location updates as soon as they occur. In one of my PB application which uses PB (on Android runtime) i get location updates typically every 2-3 seconds when device is locked on satellites.

 

Regarding oddometer on Pb, i think this would be unpractical application for user, if someone want to go on hiking trip on foot, it is unlikely it would carry PB with him. PB is not really a pocket fit device, anyway, that's just my opinion, good luck.

Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Location Services - How accurate?

Playbook is just my test device, I don't have anythign else.  But I don't have to have it as my only target device.

 

Do you have sample code of using the update interval?  

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Location Services - How accurate?

[ Edited ]

I have it, but its Android runtime app, not native, if that would be helpfull to you, i can send you code snippet of listener.

Same must be possible with native or webworks.

 

Btw, did you read this:

https://developer.blackberry.com/native/reference/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_ref/to...

Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Location Services - How accurate?

No, I came from using WebWorks, but was frustrated with the lack of control of location events.

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Location Services - How accurate?

Well, i can confirm you that i get location updates od Android runtime app every 2-3 seconds when location is acquired. I'm certain that same behaviour would be on native app too.

Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Location Services - How accurate?

I don't want to have to write a native app, but it seems WebWorks just won't provide the same location updates.

Highlighted
Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Location Services - How accurate?

I take a look at WebWorks API, did you read this:

https://developer.blackberry.com/html5/apis/positionoptions.html

 

Make sure that you set enableHighAccuracy property to true, and that you set maximumAge  attribute to lets say 1000 milliseconds. Don't know exactly what third attribute timeout means, but try to play a little with it also.