-2

In my application I'm using Google Maps and getting latlon from onLocationChanged(), while it's running in background and also getting that value using services.

Due to this, a lot of battery power is consumed by my application

How can I reduce my application power consuming?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
MurugananthamS
  • 2,395
  • 4
  • 20
  • 49
  • https://stackoverflow.com/questions/20278873/how-can-i-save-battery-power-using-in-writing-app – Anil Dec 07 '17 at 10:47
  • How do you implement the services? Do you use a `Timer` or `AlarmeManager`, or you just keep listening to `onLocationChanged`? – AhmadWabbi Dec 07 '17 at 10:47
  • 1
    https://developer.android.com/training/monitoring-device-state/doze-standby.html – Anil Dec 07 '17 at 10:47
  • 4
    Rewirte the app ... especially you should change line 666 in ThererIsNoCode.java – Selvin Dec 07 '17 at 10:48
  • 1
    https://stackoverflow.com/questions/28200818/get-location-coordinates-periodically-without-dramatically-increase-battery-co – Maddy Dec 07 '17 at 10:48

1 Answers1

1

Here you go:

Use setPriority(LocationRequest.PRIORITY_LOW_POWER); in LocationRequest

See documentation Here:

Ronak Thakkar
  • 2,515
  • 6
  • 31
  • 45