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
ashtonj
Posts: 15
Registered: ‎05-03-2011
My Device: 9900 Bold
Accepted Solution

use of blackberry.location in Ripple emulator

I'm trying to do Geolocation using the blackberry.location API as documented here https://developer.blackberry.com/html5/documentation/blackberry_location_568404.html

 

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.

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: use of blackberry.location in Ripple emulator

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/documentation/tutorial_create_first_app_part1_1970681_11.html

 

Download the files needed.  Look at the geo.js file particularly.  I think for OS6 you should be using Geolocation API and not location.

 

If it helped you, click like. :smileyhappy:
Please use plain text.
Contributor
ashtonj
Posts: 15
Registered: ‎05-03-2011
My Device: 9900 Bold

Re: use of blackberry.location in Ripple emulator

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!

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: use of blackberry.location in Ripple emulator

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...

If it helped you, click like. :smileyhappy:
Please use plain text.
Contributor
ashtonj
Posts: 15
Registered: ‎05-03-2011
My Device: 9900 Bold

Re: use of blackberry.location in Ripple emulator

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.

Please use plain text.