Schore
Schore

Reputation: 133

What is influenced by Android Wakelock?

I am currently developing an app that runs a service from time to time. Currently, the service acquires a wakelock, reads some sensors and sends some information over WIFI (if any). Now what I want to know is weather a wakelock influences sensors and connectivity or not. Is it possible to do these tasks without any wakelock?

Cheers

Upvotes: 1

Views: 1041

Answers (1)

Raghav Sood
Raghav Sood

Reputation: 82533

A wake lock is essentially used to lock the device in an "awake" state, in which the CPU will be on, and the screen may or may not be on.

It is not possible to do these tasks without a wakelock if the phone is in sleep otherwise, as then the CPU is also in sleep mode. However, if the user is using the device for something else, and your app is in the background, you can do these tasks without a wakelock.

Keep in mind that almost everything you're doing is battery intensive (sensors, WiFi, wakelock) and you should not do it too often so that you don't degrade the user's battery life.

Upvotes: 1

Related Questions