11-02-2012 05:18 PM
I'm trying to do Geolocation using the blackberry.location API as documented here https://developer.blackberry.com/html5/documentati
I have the following in my config.xml file
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0" rim:header="RIM-webworks:rim/webworks" xmlns="http://www.w3.org/ns/widgets">
<name>Geo Location Proof of Concept</name>
<description />
<author href="" rim:copyright="" email="">Me</author>
<content src="index.htm" />
<feature id="blackberry.app" required="true" version="1.0.0.0" />
<feature id="blackberry.system" required="true" version="1.0.0.0" />
<feature id="blackberry.location" required="true" version="1.0.0.0" />
<license href="" />
<rim:cache disableAllCache="false" aggressiveCacheAge="2592000" maxCacheSizeTotal="1024" maxCacheSizeItem="128" />
</widget>
I assumed the "feature id="blackberry.location" tag would get me access to the API, but it does not appear in Ripple, where I'm emulating a Bold 9700 with OS 6. Other properties of the "blackberry" API show up, but not "location".
Any ideas?
I'm specifically trying to use this one because I want the functionality provided by the "setAidMode" method. I need to ensure GPS location is being used, rather than triangulated or cell-based estimate.
Thanks in advance,
Jim Ashton.
Solved! Go to Solution.
11-04-2012 04:42 PM
Your config.xml will need something ilke this to give permission to use the GPS:
<rim:permissions>
<rim:permit>access_location_services</rim:permit>
</rim:permissions>
Work throug the example app here:
https://developer.blackberry.com/html5/documentati
Download the files needed. Look at the geo.js file particularly. I think for OS6 you should be using Geolocation API and not location.
11-07-2012 11:47 AM
As suggested, it turns out OS 6 doesn't work with the API I wanted. Just 5 and below. So I have a working app, but don't know how to confirm it is actually getting positioning from GPS, rather than estimating. I guess it depends on device settings. Maybe I can have the app update those settings to match my requirements. Any suggestions certainly appreciated!
11-07-2012 03:10 PM
Again take a look at the geo.js in that sample. There is a line that says:
// options = { enableHighAccuracy : true, timeout : 60000, maximumAge : 0 };
the enableHighAccuracy option which gets passed to the getPosition function is accurate using GPS device, while not using this setting the gps may be relative. ie: enableHighAccuracy = true, is pin point gps while enableHighAccuracy = false will use wifi and cell to triangulate you.
Other devs may want to correct me if I'm wrong here, but thats the way I understand it...
11-07-2012 03:15 PM
That's how I understand it also. I just want to be able to ensure that the only fallback position is total failure, rather than the use of wifi and cell to triangulate. As in, full GPS or nothing at all. With blackberry.location it was (at least as I read the documentation) possible to be specific about this - with the "enableHighAccuracy" parameter, I'm not sure what it does if high accuracy is unavailable, and that is important in this situation.