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

Native Development

Reply
Developer
Posts: 70
Registered: ‎04-20-2012
My Device: BB 9105
My Carrier: Vodafone

Location API doesn't work when device is locked

[ Edited ]

Hi,

 

I have application which tracks the device all the time. The problem however is, it stops tracking as soon as device is locked. Aparently, QGeoPositionInfoSource's positionUpdated signal is not triggered when device is locked.

 

Please note that:

1. I have set run When backgrounded to true

2. I have set updateInterval to 5 seconds.

 

The application gives location updates when it is minimized, however it doesn't when phone is locked.

 

Anyone else faced this behaviour? Any advice would be helpful

 

Thanks

Brsengar

Retired
Posts: 68
Registered: ‎10-15-2012
My Device: Z10
My Carrier: Telus

Re: Location API doesn't work when device is locked

Hi Brsengar,

 

Try calling 

 

source->setProperty( "canRunInBackground"true );

 

before starting updates ( source is an instance of QGeoPositionInfoSource).

 

 

The underlying backend for the default (BB10) QGeoPositionInfoSource requires additional configuration not supported via the QtLocationSubset interface to allow an app to receive position updates when the device is in standby or locked. This is accomplished using the Qt property system and is documented here: http://developer.blackberry.com/cascades/reference/qtmobilitysubset__qgeopositioninfosource.html

 

 

Regards,

Jim