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
New Contributor
makifcakar
Posts: 4
Registered: ‎04-02-2012
My Device: Playbook

Auto-run On Startup Feature

Hi folks;

   I want to port my existing BBOS Java apps to BB10 Native platform. While checking the features that I use earlier I found some issues.

1. I can't find any sample code that runs in background.

2. How could I define that app should automatically run on startup? That so easy in java sdk.

 

I will be happy If I can get sample application code.

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Auto-run On Startup Feature

Neither of these features is supported yet, nor will they be by launch (according to the last statement I heard on the matter).

 

Certain use cases can take advantage of the Invocation Framework and/or the Push Service to remove the need for background services or auto-run. Perhaps your app can use one of those for now.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
smiley
Posts: 1,473
Registered: ‎07-14-2008
My Device: Z10

Re: Auto-run On Startup Feature


peter9477 wrote:

Neither of these features is supported yet, nor will they be by launch (according to the last statement I heard on the matter).

 

Certain use cases can take advantage of the Invocation Framework and/or the Push Service to remove the need for background services or auto-run. Perhaps your app can use one of those for now.


peter: so for alarm clock type apps how would you use push service or invocation to wake up the application to play the alarm without running in in the background?

 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Auto-run On Startup Feature

I'd be expecting integration with the Calendar service in some fashion that would allow us to register an app to be invoked at a particular time. Push wouldn't be an appropriate mechanism in that case because it relies on network access.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
New Contributor
makifcakar
Posts: 4
Registered: ‎04-02-2012
My Device: Playbook

Re: Auto-run On Startup Feature

For predefined and recurring alarms maybe we can add notification as calendar event but my application requires periodic controls(at least every 5 minutes). Since there is no option to subscribe app to calendar service, I can't port my applications to BB10 platform. :No:

Please use plain text.
Developer
tommy20
Posts: 255
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Auto-run On Startup Feature

Hi Peter and others,

 

I've read other threads through the forums on "background running and auto-start at boot". I know that there is currently no support for this. While I am waiting for this, I am looking for an alternative approach using the current APIs. My app needs to continuously track the user location (e.g., for every 10 minutes) to do something... How do I do this?

 

Thanks,

Tom

--tom
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Auto-run On Startup Feature

There's a restricted access permission called "run_when_backgrounded" which does at least let apps carry on processing even when they're not fullscreen. They must be running -- there's no way to do this without them actually running -- but at least you can keep doing it even if the user minimizes that app and switches to others.

Beyond that, or a creative (and probably inappropriate) use of the Push service, you have no other options yet. Also nothing that could help with the auto-start, beyond Push or possibly a calendar entry that wakes you up (again, neither one likely being appropriate for that).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
tommy20
Posts: 255
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Auto-run On Startup Feature

Thanks a lot for your time, Peter.

(But you repeated your comments which have been posted on the other similar topic threads, :smileyhappy:

 

In conclusion, there is currently no appropriate and possible way to implement my app's use case. This is another request that RIM may need to consider for the next SDK release. Otherwise, "mobile" but not "context-aware" could mean "death".

 

Cheers,

tom

--tom
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Auto-run On Startup Feature

Sorry I repeated comments you'd seen. I post too much to keep track of who has asked which questions, or seen other answers, so I didn't realize if you've already asked or I've already answered similar things before.

I know RIM is working on stuff in this area. It just doesn't exist yet and, according to the last answers I was given, will not be available before launch for us, as independent developers. And yes, I probably said all that elsewhere before too! ;-)

By the way, I'm disappointed about it all too. I have several apps which really would benefit from being able to run a service that way, Battery Guru being the most obvious but not the only one.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.