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
My Carrier: 3AT

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?

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

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!
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

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!
Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

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
Please use plain text.
Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha
My Carrier: -

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

Please use plain text.
Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha
My Carrier: -

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

Please use plain text.
Contributor
Gerii
Posts: 33
Registered: ‎04-30-2012
My Device: PlayBook, DevAlpha
My Carrier: 3AT

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>?
Please use plain text.
Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha
My Carrier: -

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

Please use plain text.
Contributor
mserina
Posts: 44
Registered: ‎11-12-2012
My Device: BB 10 Dev Apha
My Carrier: -

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

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

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
Please use plain text.