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

Running app while screen is turned off

[ Edited ]

I've written an app that allows the user to create a GPS track. This works fine when the screen is on (even when the user switches to another application as I have run_when_backgrounded in my config.xml), but as soon the screen is turned off, navigator.geolocation.watchPosition doesn't return any coordinates anymore.

As soon as the screen is turned back on, I get new coordinates again, but this isn't practical as my app is supposed to record a track while the user is making sports so the phone is in his pocket or backpack and the screen is turned off (to avoid random input and to save battery).