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
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry

Issue about Get current location via GPS (BlackBerry Playbook version 2.0.1.158)

Hi everyone,

 

I am developing WebWorks for playbook.

I want to get current location via GPS, but it is nothings!!!

Although, I just refer http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-...

 

See your response soon!

Regards,

An Pham

Developer
rorybarnes
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900

Re: Issue about Get current location via GPS (BlackBerry Playbook version 2.0.1.158)

[ Edited ]

It would be much easier for people to help if you could post your code and config.xml, not just the link to where you got it. People can thenhave a look at it to see if there are any errors in it.

 

Also could you be more specific with: do you receive any error messages, if you do what are they? What debugging steps have you already done, what was the result?

 

Is this in Ripple, the simulator or on device?

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry

Re: Issue about Get current location via GPS (BlackBerry Playbook version 2.0.1.158)

Hi rorybarnes,

 

My config.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" id="idRetailStar" version="1.0.0.6">
<name>My app</name>
<description>My app</description>
<author email="phan@gmail.com">An Pham</author>

<feature id="blackberry.identity" required="true" version="1.0.0.0"/>
<feature id="blackberry.message" required="true" version="1.0.0.0"/>
<feature id="blackberry.io.dir" required="true" version="1.0.0.0"/>
<feature id="blackberry.io.file" required="true" version="1.0.0.0"/>
<feature id="blackberry.invoke.CameraArguments" required="true" version="1.0.0.0"/>
<feature id="blackberry.media.camera"/>
<feature id="blackberry.find" required="true" version="1.0.0.0"/>
<feature id="blackberry.app" required="true" version="1.0.0.0"/>


<feature id="blackberry.system" />
<feature id="blackberry.connection" />
<feature id="blackberry.invoke"/>
<feature id="blackberry.utils" />

<feature id="blackberry.app.event"/>

 

<icon rim:hover="false" src="WebContent/images/app_logo.png"/>
<icon rim:hover="true" src="WebContent/images/app_logo.png"/>

<content src="login.html">

</content>

<rim:smileysurprised:rientation mode="landscape" />


<rim:loadingScreen backgroundColor="#063a6b"
onFirstLaunch="true"
onRemotePageLaunch="true"
onLocalPageLoad = "true">
<rim:transitionEffect type="zoomIn" direction="slideOver" duration="1000"/>
</rim:loadingScreen>

<access subdomains="true" uri="*"/>

<rim:smileytongue:ermissions>
<rim:smileytongue:ermit>access_shared</rim:smileytongue:ermit>
<rim:smileytongue:ermit>read_geolocation</rim:smileytongue:ermit>
<rim:smileytongue:ermit>use_camera</rim:smileytongue:ermit>
</rim:smileytongue:ermissions>

</widget>

 

and my code:

 

function geolocationSuccess(position)
{
var lat = position.coords.latitude;
var lon = position.coords.longitude;
alert("location: " + lat + "," + lon);
}
function geolocationError(posError) {
alert("Error " + posError.code + " : " + posError.message);
}
function getPosition(params) {
navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError, null);
}

 

 

See your response soon!

 

Regards,

An Pham

Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry

Re: Issue about Get current location via GPS (BlackBerry Playbook version 2.0.1.158)

Hi everyone,

 

I use device, but it is nothings

Although, it work well on Ripple

 

Any idea for me?