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
Developer
Posts: 59
Registered: ‎09-05-2013
My Device: Z10
My Carrier: *
Accepted Solution

Headless vs Invisible

Hello,

I am working on an application that needs to perform tasks in the background. From what I have understood with Cascades I have two options: use a headless application or make the app invisible (run_when_backgrounded). Now I would like to ask which solution is better for me depending on:

  • Performance, which option will be faster?
  • Battery consumption, my app needs to run all the time.
  • Complexity, which option offers a simpler approach?
Developer
Posts: 849
Registered: ‎03-03-2011
My Device: Z10

Re: Headless vs Invisible

Run-when-background means two things:
- app must be started manually from home screen, and
- when closing app by tapping on X, the app is closed.

Performance/consumption depends on your development techniques and not on the type of app.

When invisible (minimized), app just runs so there is no extra coding neded, In case of headless app, you have some work to do and you have to request for permission.

In case of headless apps, BlackBerry can also deny your app when requesting to publish if it abnormally consumes battery power and CPU.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Highlighted
Developer
Posts: 59
Registered: ‎09-05-2013
My Device: Z10
My Carrier: *

Re: Headless vs Invisible

Thank you, the documentation says that headless apps use max 3 MB of RAM, now if run my app in the background the amount of the RAM consumed will be the same as when used normally?
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Headless vs Invisible

The run_when_backgrounded permisison just means that the app can still run if the user minimizes the app or switches to another (instead of just freezing). It gets deprioritized, but you don't lose access to RAM. The user can close it at any time, as can the OS if it decides it's running low on memory.

 

So if you need it to be running, headless is the way to go, though because it does get to run in the background, there are memory limits and you don't get a lot of processing time.

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