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
linuxq
Posts: 12
Registered: ‎02-29-2012
My Device: non yet

Geolocation on Playbook: Only brings back Timeouts - no Position :(

Hi,

 

I want to port a Enyo2 (www.enyojs.com) app to the PlayBook. It works pretty good on webOS and in Chrome and it uses HTML5 geolocation. But on the Playbook I only receive "Timeout expires". Only one time (out of 200) I got the coordinates as response on my PlayBook! The permissions are also set in the config.xml 

 

I don`t think it is my code, since it works on the other platforms and it also responsed once with coordinates and otherwise with a timeout. I also tried the example app for Phonegap. It shows the same problem: "Timeout expired" BTW: I use this HTML5 geolocation enyo kind: https://github.com/robertkowalski/enyo-geolocation

 

What could be the problem? 

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

[ Edited ]

Hi.

 

Are you using getCurrentPosition or watchPosition to get the coordinates within your app? On PlayBook it takes a while until you receive data from GPS, it seems the "fix" needs a little bit of time. Some days for me here, when using the watchPosition approach it takes up to 2-5 minutes to get coordinates instead of the "Timeout expired" output.

 

BTW: Regards to Germany from Germany :smileywink:


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Contributor
linuxq
Posts: 12
Registered: ‎02-29-2012
My Device: non yet

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

Hi,

 

Thanks for your reply. I use getCurrentPosition! Which values do you use for timeout? I tried 10000ms, and maximumAge 600000ms.

 

BTW: Just found out the stock bing maps app on the playbook can't locate me either. OK, the 8GB PB has no GPS, but WLAN geolocation should work, right? On webOS Google Location (if GPS turned off) works pretty good. Thus the PlayBooks WLAN based location doesn't seem to know where my WLAN is. It isn't tied to google services as it seems. 


Is there anything I can do about that?

 

Greetings from Germany

 

Marcel (@linuxq]

 

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

Hi Marcel.

 

The issue with the "Timeout expired" is something that would lead me to not use getCurrentPosition and instead use the watchPosition approach. When you have a closer look to the BlackBerry API you will find that navigator.geolocation.watchPosition gives back a value (eg. 1, 2, ...). Using this you could define something like this:

 

var myGPSWatch = navigator.geolocation.watchPosition(positionCallback, positionError, options);

This will, perhaps, start with a "Timeout expired" but will go on and sometime it will respond with the coordinates you want to have. This will be in the "positionCallback" function I use above. Now we could clear the watcher, what means we can remove the event for the positioning like this:

 

function positionCallback(coordinates) {
   // your stuff to work with the coordinates

   // now you might want to cancel the watchPosition event since position-data arrived
   navigator.geolocation.clearWatch(myGPSWatch);
}

In that case you will be able to receive data and if so you remove the watchPostion handler.

 

For your WLAN positioning (issue) on PB I haven't worked with it until now.

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Contributor
linuxq
Posts: 12
Registered: ‎02-29-2012
My Device: non yet

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

Ok, I'll try that! Maybe that helps!

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

Let me know about it.

 

Grüße.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

BTW: You ever read this Knowledge Base article about GPS and WLAN positioning on PlayBook: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-...


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

I am having the same problem with my Playbook.  Even stock apps DONT return a gps location.  I've tried downloading others from appworld but all have the same problem - long wait and no GPS!

 

The specs all say it has GPS but its super lousy right now.  I have followed all the suggestions - being outdooors etc...  Nothing.

If it helped you, click like. :smileyhappy:
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

As far as I know and also the PlayBook specs page says there is always GPS in there: http://us.blackberry.com/playbook-tablet/tablet-specs.html

 

Never heard about any PlayBook without GPS but I could be wrong.

@The_Anomaly: What about the permissions for your apps? Do you allowed access to the GPS when installing? Did they ask you to use GPS?


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Geolocation on Playbook: Only brings back Timeouts - no Position :(

I finally got it to work after repeatedly hitting the refresh / GPS button on bing and the other apps.  It took about 5 mins to kick in!  

 

I'm still not convinced my GPS is fine because the map apps insist on wifi connection for the maps making it possible to pinpoint location via internet...

 

So it seems to be working but... not very well.

If it helped you, click like. :smileyhappy:
Please use plain text.