Android Question PartialLock: When use it?

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi! I want to ask 2 questions about PartialLock.
I have 2 different service in my app: one about gps, and one called by intent filter when there are connection changed events.
My service for gps is a sticky service: Should i acquire a partial lock to keep service running?
Should i use acquire a PartialLock in second service? I though no, because service is called by a broadcast intent, but i'm not sure. Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
A partial lock is required if you want to keep the CPU running when the screen is off.
Note that a sticky service in most cases will not be restarted if the device is sleeping.

Should i use acquire a PartialLock in second service?
When the app is waked up because of an intent, it is given a short period to run. If the service needs to run for a few seconds then you don't need a partial lock.
 
Upvote 0
Top