05-11-2012 03:07 AM
At BlackBerry 10 Jam it was mentioned that with BlackBerry 10 it is now possible to run "services" in background. Is there an how to for that available? I can't seem to find a "service" option in the latest NDK when creating a new app.
05-11-2012 09:08 AM
05-13-2012 11:24 AM
Doing things in the background was mentioned a few times in DEV175, but no concrete API's were discussed.
05-13-2012 11:18 PM
I just searched the DEV175 presentation and there was only one mention of the word "background".
I think the presenters were referring to an app which was running, but may not be in the foreground. The context of that segment seemed to be when your app isn't in the foreground, it may be impolite to go off and do some power-intensive activities.
05-14-2012 01:41 AM
There was a lot of talk in that session about tracking the activity of a user to make intelligent guesses. For instance, if a users leaves wifi coverage around the same time each morning, he's probably starting a daily commute and may want travel info. Another example was an intelligent shopping list using location to pop up reminders. Neither of these would be practical or even possible without background tasks.
There are many, many use cases for background tasks. Just look at the flack IOS got for not doing it, and still gets for not doing it right.
I expect you'll agree that it is somewhat strange we must resort to the Android runtime to get anything resembling background tasks on PlayBook while RIM boasts about the multi-tasking capabilities of QNX...
05-14-2012 09:56 AM
Contact the presenters and ask for clarification. Everything you're describing would work fine today with a launched app that may not be in the foreground as far as I can tell.
Regardless, there are no such APIs yet for spawning application services. I recognize the value in such functionality, as I'm sure everyone else does, but as I understand it, a usage model has not been formalized yet.
iOS may have got flack for it, but iOS only lets you run one app at a time. This is not the case on PlayBook or BB10.
Cheers,
Sean
05-14-2012 11:12 AM
I spoke with the presenters of DEV175, and here is the clarification I received...
We were hoping to give some example code for listening to whether the app window has been "backgrounded", or is not currently visible, and using the Notification API to put a flag on the home screen; to indicate to the user they should come back to the app because something noteworthy happened.
So the discussion was not meant to imply that an application "background service" API was available, although everyone is well aware that this is a desired feature. They were talking about a regular app running backgrounded (eg. not fullscreen). All doable today.
Cheers,
Sean
05-14-2012 12:58 PM
smcveigh wrote:
iOS may have got flack for it, but iOS only lets you run one app at a time. This is not the case on PlayBook or BB10.
Wow, that's very outdated info. IOS has let you run multiple apps and background tasks since IOS 4.0, two years ago. It's not the best implementation or usable for all situations, but still...
05-14-2012 01:03 PM
smcveigh wrote:
I spoke with the presenters of DEV175, and here is the clarification I received...
[...]
So the discussion was not meant to imply that an application "background service" API was available, although everyone is well aware that this is a desired feature. They were talking about a regular app running backgrounded (eg. not fullscreen). All doable today.
Technically doable, yes, but not practical for the end user. It's too easy to close an app and forget to reopen it. Let's hope they sort it out soon. With a phone form factor, 4G and the new invocation framework, the need will be more prevalent than ever.
05-14-2012 01:10 PM
Innovatology wrote:
Technically doable, yes, but not practical for the end user. It's too easy to close an app and forget to reopen it.
Playing devil's advocate here.. and this is part of the reason such a facility isn't available yet...
The flip side of it being too easy for a user to close an app is that it is difficult or unintuitive for a user to determine how to shut down a service that has no corresponding app close button they can hit. If my device is behaving really sluggishly, and I only have the camera open, how am I supposed to know that my location-aware-todo-list app is stuck in a run-ready loop when as far as I can tell, this app isn't running? Most likely, I will just complain or file bug reports which are entirely unrelated to the camera.
I know there are solutions to this problem (eg. a process manager of some sort), but they are not as straightforward or simple as just allowing apps to fork() with impunity ![]()
Cheers,
Sean