08-29-2012 02:57 AM
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?
08-29-2012 03:03 AM - edited 08-29-2012 03:04 AM
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 ![]()
08-29-2012 04:21 AM
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]
08-29-2012 04:49 AM
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.
08-29-2012 05:05 AM
Ok, I'll try that! Maybe that helps!
08-29-2012 05:11 AM
Let me know about it.
Grüße.
08-29-2012 05:23 AM
BTW: You ever read this Knowledge Base article about GPS and WLAN positioning on PlayBook: http://supportforums.blackberry.com/t5/Web-and-Web
08-29-2012 06:24 AM
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.
08-29-2012 06:44 AM
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-sp
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?
08-29-2012 02:29 PM
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.