Permission WAKE_LOCK

jaimzj9 years ago

Dear Anton,

I am sorry about the random questions I keep shooting your way. just trying to understand the application based on what I see as I use the application.

Why is the WAKE_LOCK permission used by the APP. Where or for what function is it needed.

  1. For I have seen other communication apps, which work and recieve data even without the wake_lock permission. One such example would be the applications like "Whatsapp" and other chat messengers.
jaimzj9 years ago

Oops, I have posted a wrong info on top. I would re-phrase it.

  1. Correction is APPS like Whatsapp do use WAKE_LOCK Permission.

I would rephrase the question, How do they still manage to have a lesser battery / and cpu usage? compared to Traccar Android App.

Version 3.2
Frequency Set to 5 mnts.
15kb data transfered in 24 hours.

Where-as these chat messengers, keep receiving data like crazy every minute.

Anton Tananaev9 years ago

Traccar Client constantly uses GPS module. That's the only reason it uses more power than any other app. GPS consumes much much more power than GSM module (data transfer).

Anton Tananaev9 years ago

As for WAKE_LOCK, we need it to keep checking for location updates.

jaimzj9 years ago

Anton, this WAKE_LOCK in Traccar Client.

I notice in the code, If am not wrong at how I Interpret the code.

It is set to acquire() when the service is enabled.

and is set to release() when the service is disabled.

Is there no way to make ti dependent on the frequency that has been set. based on which it will acquire() and release() only when needed? thus saving battery

Anton Tananaev9 years ago

No, if we don't acquire wake lock, the app might not wake up after selected period of time.

pinheiro5 years ago

good afternoon everyone
I'm new here and would like to know how to make traccar notifications on
Whatsapp

thank you!