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
Regular Contributor
kokoman
Posts: 76
Registered: ‎11-13-2012
My Device: curve 9300

html5 gps api

Hello developers and contributors, looking to create an application, that would work using a gps api, showing you available places around your location, available places e.g" hotels around, close to your location" any advice or response on how to go about it? Thanks
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: html5 gps api

It's quite easy (and hard)

 

The easy bit it getting the GPS co-ordinates and feeding them into a map

 

I've got a little test mapping app I wrote in the summer that follows me around showing me where I am

 

The problem you have is that GPS is unreliable - if you take only the readings you get you bounce around a lot

 

You can sit in the same spot and watch yourself move all over the place (not useful)

 

There are ways to smooth out this issue, the best being a Kalman Filter - sadly this ain't practical in real time using JavaScript

 

The next best is Least Mean Squares - which I've actually built into my test app

 

These sorta guess where you are based on where you were and as such get rid of the bouning around problem

 

Next you need to know where you wanna go / mark

 

This requires the exact lat / long of the <whatever>

 

Simple example - mark where you parked your car from the app

 

Go walkies, get lost - switch to car finder mode and you can map yourself and your target

 

Getting a bit more complex you can use the magnetometer to point you at your target

 

This is like having a compass that points at the target (more complex maths)

 

Of course if there's an obstacle in the way you'll have to manouver around it to hit the target

 

 




Click the like button if you find my posts useful!
Regular Contributor
kokoman
Posts: 76
Registered: ‎11-13-2012
My Device: curve 9300

Re: html5 gps api

Wowwwww
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: html5 gps api

1.  GPS api

2.  App goes online to call home and tell where you are.

2.  Backend server replies with nearby places of interest. <- lot of work, investigate other mapping services for this.

 

Problems:

GPS comes in 2 flavours - Absolute and Relative.  Absolute uses an actual GPS hardware to find you.  Relative uses your ISP and WiFi etc... to find you.  Absolute is more accurate but you can't force that only, because you'll limit your apps reach in terms of users with the right device.  Relative can be way wrong.

 

Having a successful backend server calculating nearby locations and actually filling it with places of interest would take money and contacts.  Best you investigate google and other services which provide this type of thing.

 

Webworks apps have a memory limit which is exceeded by many of the map providers so you have to use something like leaflet (google leaflet maps) which compresses the map tiles for memory usage if you want to include maps in your app.

If it helped you, click like. :smileyhappy:
BlackBerry Development Advisor
chadtatro
Posts: 620
Registered: ‎10-01-2009
My Device: Z10

Re: html5 gps api

Check out my "Maps" sample.  It shows how to do this exact thing :smileyhappy:

 

https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/Maps

 

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: html5 gps api

See the other thread on this (no point typing everything twice)

 

GPS is admitted as broken but in the process of being fixed before gold SDK




Click the like button if you find my posts useful!
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: html5 gps api

There are several topics related to this so I've made a new post so I don't have to write it many times

 

I've tried it on my Dev Alpha and - yahoo - callback with positioning!




Click the like button if you find my posts useful!