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

Regular Contributor
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks
My Carrier: zcon

Implement Headless application

Hi All,


I am trying to use long running headless app concept for my project.


My application need to send some logs to the server even if application is forcefully closed.

My project is already develop and now I want to add headless concept in application. Do I need to modify my current project structure to implement headless application.


I got long running headless app permission from RIM. Now want to use it. But not able to understand how.


Please help me....

Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Implement Headless application

It's easier to start from a headless project than retrofit an older app.


Download the sample apps to understand the code better, it's not easily explained by forum.

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Implement Headless application

In my opinion, I don't think the requirement to send logs is a great use case for creating a long running headless app.  While your app is running, you have the opportunity to send logs as you need to make sure at any point there is not too much to send.  Then you have a few seconds (which can be extended) when your app is closed to clear the rest.  Creating a headless app to detect a force close of your application and then send logs seems to be a sledgehammer to crach a nut, at least to me. 


If you are concerned about this sort of thing, you need to also think about what would happen if the user pulled the battery out of the device? 


Perhaps another option is to log the outstanding data to be sent, and not let the user restart your application until this is cleared.

Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Implement Headless application

Peter is correct, having a headless app does not guaruntee that the app will be running. The user can also just close them from the Device Monitor app if they like. Or uninstall.


Another option to send the logs would be to send them in an email and let the system handle the delivery.

Paul Bernhardt
Application Development Consultant

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker