10-05-2009 02:52 PM
While viewing a broswer page, I want to click a rado button and capture the coordinates of the GPS,and bring them into the web form.
How can I caputre the GPS coordinates?
10-05-2009 03:26 PM
10-05-2009 07:05 PM
Thanks for the reply. I am very new to BlackBerry development, so if you could point me in the right direction, even with some samples, it would be very much appreciated.
10-05-2009 07:16 PM
The first place to start is the documentation - it includes information about the capabilities of the browser (including GPS Support) and sample code for implementing it. If you look there, you'll find exactly what you're looking for. Go to the BlackBerry Developers web site (www.blackberry.com/developers), select Developer Documentation then Browser - read through the Browser Content Developer Guide (last published for BlackBerry Device Software 4.3 - now called the Fundamentals guide) and the JavaScript Guides - both located in the same place:
http://docs.blackberry.com/en/developers/subcatego
There's also this really cool book being released in 11 days called BlackBerry Development Fundamentals - it's a book designed for brand new BlackBery developers. It contains everything you need to get started with BlackBerry development - including the answer to this post (how to access location information in the browser with sample code).
10-06-2009 09:06 AM
10-06-2009 09:36 AM
I'ts just JavaScript. You have a Location Object (blackberry.location) plus properties and methods you can access within that object.
From chapter 9 of BlackBerry Development Fundamentals:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> </HEAD> <BODY> <SCRIPT type="text/javascript"> <!-- if(blackberry.location.GPSSupported) { blackberry.location.refreshLocation(); document.write("The client BlackBerry device is currently located at " + blackberry.location.latitude + " degrees latitude and " + blackberry.location.longitude + " degrees longitude."); } //--> </SCRIPT> <NOSCRIPT>Sorry, this browser does not support JavaScript!</NOSCRIPT> </BODY> </HTML>
10-20-2009 08:59 AM
I get "0" for my longitude and latitude. I have the location finder enabled in the BlackBerry, so what am I doing wrong?
10-20-2009 09:07 AM
Are you using the simulator or a physical device? Some simulators return 0 for longitude and latitude until you change the coordinates. Enable the JavaScript Location API in the browser settings.
10-20-2009 09:10 AM
It is a physical device (my tour), and I do have JavaScript Location API running in the browser settings. Any other ideas?
10-20-2009 09:18 AM
Verizon Tour? Doesn't Verizon disable GPS on BlackBerry devices and force you to purchase their location services? That is the way it was on the 8830, the device had GPS hardware, the carrier disabled it.