cancel
Showing results for 
Search instead for 
Did you mean: 

Background service eating up the device battery - Android platform

Former Member
0 Kudos

Hi everybody,

When the SUP server is unreachable (the connection times out), I've set the application to work in off-line mode, that is, initializing the application with the following code:

Application app = Application.getInstance();

if (app.getApplicationIdentifier() == null) app.setApplicationIdentifier("identifier");

app.setApplicationContext(getApplicationContext());

This way, I'm able to call the MBO operations without connecting with the SUP server.

But then, analyzing the application logs, I've noticed that a background service was started (probably by the SUP API) and tries to connect to the SUP server.

The problem is that the interval between each try, is only a few seconds, this is eating up the device's battery. There is a way to increase this interval?

Thanks in advance!

Best regards,

Danilo

Accepted Solutions (1)

Accepted Solutions (1)

DanielSilva1
Advisor
Advisor
0 Kudos

Hi, Danilo.

We got the following answer from Dirk Olderdissen in the internal forum. I really think you don't need to be worried about that, since this interval grows exponetially.

Regards,

Daniel Silva

------------------------------------------------

To me this looks like works as designed. But maybe the R&D guys can confirm me being right/wrong 🙂

The MOCA component in the log you posted is the messaging engine, trying to establish a connection pipe with the SUP server. Over this connection pipe new message notifications etc are delivered to the device.

In the past, the established procedure was to extend the duration between each connection attempt over time, to prevent the battery from draining, but still being able to re-establish the connection automatically without end user intervention. And, the log proves that the engine does that: The engine does three consecutive connection attempts every 20 secs. Then waits some time. This time delay is extended with every connection attempt triplet.

From the log:

MocaClient connection status changed: WAITING_TO_CONNECT delay = 160  MocaClient connection status changed: WAITING_TO_CONNECT delay = 320  MocaClient connection status changed: WAITING_TO_CONNECT delay = 640  

This procedure has proved itself to be fairly efficient over time (and it has been around longer than Android), so I expect you do not need to be worried about unnecessary power consumption.

Answers (0)