3

My app is draining a lot of the battery, but I don't know what in my app could be causing this. What is a good way for me to determine what part of my app is causing such a huge drain on the battery?

EDIT :
So I found out my Location Listener was not being unregistered, and I fixed that.

Hank
  • 3,367
  • 10
  • 48
  • 86
  • 2
    If you have location based code in your app, that'll most likely consume the maximum battery. – Brahadeesh Aug 08 '11 at 19:37
  • @Brahadeesh Even if I register a Listener, get an update, and unregister it? – Hank Aug 08 '11 at 19:38
  • @Hank: You could try not registering, fake the update, and see whether that makes a difference to the power drain. – MRAB Aug 08 '11 at 19:48
  • @Hank No, that would not consume battery. If your app does not require GPS to locate the user, then I'd recommend you not use it. Obtain the location from the cell phone tower or wifi instead. However if your app is going to be used by people in remote areas like sea, then I'd recommend keeping GPS functionality. – Brahadeesh Aug 08 '11 at 20:34
  • How would leaving a listener registered not consume battery? Outside of location updates, what else consumes a lot of battery? – Hank Aug 08 '11 at 20:45
  • Maybe there is still an active listener or a thread executing. Can you post some source? Sorry didnt see a comment option. – Jacob Phillips Aug 08 '11 at 19:48
  • @Hank did u got solution ? – Jithish P N Jul 29 '22 at 15:59

1 Answers1

1

See Profiling with Traceview and dmtracedump

You may also find CPU Spy useful

Earl
  • 791
  • 4
  • 9