Reputation: 208032
I would like create a service to do something when some "hot situation" occurs, and by "hot situation" I mean the following:
As one can see, these tasks are "heavy" and will be run frequently – say, 15 minutes, but sometimes even more – when I have to detect the acceleration of the device.
The question I have is this: will this service drain the battery heavily?
If so, what recommendations do you have to minimize battery drain from the tasks described above?
Upvotes: 4
Views: 2684
Reputation: 11284
GPS is the top battery drainer - by having it on all the time, the battery duration will probably be cut down to half. Wireless connection is also quite a big drainer. If your app is working via the cell network, then if the phone is connecting to 3G then that probably drains as quickly as wireless connection anyway (maybe even more)...
I would suggest rethinking the usage of your service. Maybe make it into an app and have the user explicitly turning it on when he thinks to be in a "hot situation". Leave it as a service and the user might start thinking of your app as some sort of malfunctioning program and that will hurt severely your downloads/sales.
Also, to keep track of your apps battery usage, you can visit the "Battery usage panel" that lives inside Android preferences.
Upvotes: 2