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
Regular Contributor
sonalb123
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks

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....

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
peter_strange
Posts: 19,604
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.

Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

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
BlackBerry
@PBernhardt

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