10-11-2012 04:28 AM
I'm working on porting my Java app to Webworks for the BB10. The app collects geolocation data so it can be later plotted on a map. The problem I'm running into is that as soon as my device (dev alpha) locks the screen, the app is frozen so no more geolocation data is recieved, until I unlock the screen. I assume this means that the BB10 goes into standby as soon as the screen is locked. The max time before screen locking is 5 minutes, which is consistent with the max time before standby on the PlayBook. The idea is that the user can collect the location data for an hour or more, so this 5 minute limit is a show stopper.
I've searched the forums and found some similar issues with webworks apps that play audio or perform an action based on an alarm, but no solutions. There is some mention of how to solve this using the <inactivePowerMode> tag in the bar descriptor for AIR apps, but nothing for Webworks.
This seems like a major limitation for webworks apps, I'm really hoping there is a solution out there. Aside from this issue, webworks seems to have all the API's I need. I'd hate to have to switch to a native app over this one issue.
If anyone has a solution or any info on how this might be resolved in webworks for BB10, I'd certainly appreciate the help.
10-11-2012 06:48 AM
You can do this today-
10-12-2012 02:21 AM
Thanks for the reply. I tried that permission tag but it doesn't seem to change anything, with my test setup at least. I'm using a dev alpha with OS 10.0.9.388 and BB10 Webworks 18.104.22.168. Even with run_when_backgrounded in the config, as soon as the display dims the app stops getting the geolocation data until I unlock the screen. Strangely enough, it actualy does continue to run in the background if I switch to the home screen or another App, but that works with or without run_when_backgrounded.
It seems that run_when_backgrounded was added recently, anyone know what OS/webworks version is required to support it? I'd love to know whether my App is eventually going to work with a future software update, or if there is a different reason that the geolocation data is shutting off in standby which I need to address.
10-15-2012 02:37 AM
My simple test case to reproduce this is below. When the dev alpha is awake I get timer and location updates every few seconds, but if the device goes into standby for a few minutes and I wake it up, I only see timer updates, no location updates for the period where the display was off. I really hope someone from RIM can help me out with this. Unless this issue is resolved, it seems pretty unlikely that anyone can write a useful GPS tracking app.
index.htm: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html> <head> <meta name="viewport" content="initial-scale=1.0,width=device-width,user
10-15-2012 07:08 PM
On my DevAlpha with run_when_backgrounded mode, the app keep working only if it is in full screen, even when device goes to sleep. However my app doesn't work when is minimized.
10-16-2012 12:51 AM
The sample app I posted above runs when the App is minimized, or if I put another App like browser in the foreground on my dev alpha with OS 10.0.9.388. It also runs with the device in standby with the display off, but the geolocation updates stop in that case. It seems to me that the run_when_backgrounded is working as it should, it is more a case of some other OS services are shutting down in standby, but that is just my guess from playing around with test Apps.
10-16-2012 07:50 PM
I just ported a simple countdown timer from PlayBook to BB10 DevAlpha and now I can see that script keeps going on when app is in background/minimized, however minimized screen is freezed up so I can't see elapsing time.