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
Gerii
Posts: 33
Registered: ‎04-30-2012
My Device: PlayBook, DevAlpha

Re: Geolocation always times out

I have made an app now that only uses WebWorks and both getCurrentPosition and watchPosition work for me. I have tried it when going home and it did take about five minutes to get a fix (I don't have a SIM card in my DevAlpha so no AGPS is available).

Are you trying it outside? Do other GPS apps work for you?

Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Geolocation always times out

Gimme a little while - a day maybe - to talk to my contacts and I'll get to the answer




Click the like button if you find my posts useful!
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Geolocation always times out

I go to bed early so I can start early (so play while I'm not around)

 

My bloke came thru


Are you defining the right permissions in the config xml?
Off the top of my head I remember two needed (access location services and geolocatio

 

 

I'll go freeze my feet early in the AM using the new permissions

 

I can't tell you exactly what they are but I'll check with my mate again before bed

 

I imagine he's doing 'normal things' right now so should have the answer one way or the other sometime tomorrow

 






Click the like button if you find my posts useful!
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Geolocation always times out

You can see an example using geolocation from our test app here:

 

- https://github.com/blackberry/BB10-WebWorks-Framework/pull/486/files

 

If you haven't checked make sure that location services are enabled in the settings->location services, and also that you have the proper config.xml permission.

 

<rim:smileytongue:ermit>read_geolocation</rim:smileytongue:ermit>

@erikjohnzon
erjohnson@blackberry.com
Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha

Re: Geolocation always times out

Hi Erik,

i will have a look at the code sample you provided, thanks.

BTW, please take into account the following bullets:

 

- Config.xml has "read_geolocation" specified

- location services are enabled

- Everything works and the callback is received on the VMWare simulator, but as soon as I switch to the real device (DEV Alpha), I always get a timeout..no callback

- The same code used to be working on early November (sorry, i do not remember the sdk version, but it was before Gold Release)

 

Thanks a lot

-marco

Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha

Re: Geolocation always times out

A short update: I used the provided code, fine with VMWare simulator, no way with Dev Alpha device..at this point, I guess it is a hardware issue..

The error I received from getCurrentPosition call is the following JSON:

 

{"code":2,"message":"failed"}

 

thanks

-marco

Contributor
Gerii
Posts: 33
Registered: ‎04-30-2012
My Device: PlayBook, DevAlpha

Re: Geolocation always times out

I get errorcode 2 if the user removes the permission to access location data. Are you sure that you have allowed your app fo access location data in the settings app under security - application permissions - <name of your app>?
Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha

Re: Geolocation always times out

HI Gerii,

yes I am, location services are enabled and my app is listed under Gps permissions..in any case, my config.xml is the following:

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0.5" id="geolocation" xml:lang="en">
<rim:navigation mode="focus" />
<author href="http://www.example.com/" rim:copyright="Copyright 1998-2012 My Corp">myself</author>
<name>Geolocation</name>
<rim:smileytongue:ermissions>
<rim:smileytongue:ermit>read_geolocation</rim:smileytongue:ermit>
</rim:smileytongue:ermissions>
<content src="index.htm"></content>
</widget>

 

Thanks

-marco

Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha

Re: Geolocation always times out

Hi All,

the latest, annoying update :-)

I finally managed to get it working..it is simply due to my position..nearby the office (inside/outside) I have no callback, About 500m far away the response time is quite fast (2,3 seconds)..

The only thing I can do is crossing fingers until more performant upcoming devices :-)

 

Thanks to everyone

-marco

Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Geolocation always times out

Glad to hear it is *working*. Yes the dev alphas are not the best and brightest :smileyhappy:.

@erikjohnzon
erjohnson@blackberry.com