Battery drain on android


#1

On android, i get a notification that leads me to battery-draining apps, with the message: app is draining you battery. put this app to sleep to extend you battery life, and a recommendation to make the app sleep.
After some reading, it seems that candidates for the problems are the plugins: nativescript-geolocation and nativescript-push-notifications, and after some thinking i assume that nativescript-socket.io might also be a problem.

Here’s a list of my dependencies in package.json:

"@angular/animations": "4.4.6",
"@angular/common": "4.4.6",
"@angular/compiler": "4.4.6",
"@angular/core": "4.4.6",
"@angular/forms": "4.4.6",
"@angular/http": "4.4.6",
"@angular/platform-browser": "4.4.6",
"@angular/router": "4.4.6",
"moment": "^2.20.1",
"nativescript-accordion": "^5.0.3",
"nativescript-angular": "^4.4.1",
"nativescript-background-http": "^3.1.0",
"nativescript-drop-down": "^3.2.0",
"nativescript-facebook": "^2.2.0",
"nativescript-geolocation": "^4.2.0",
"nativescript-globalevents": "^1.2.1",
"nativescript-google-maps-sdk": "^2.4.2",
"nativescript-imagepicker": "^4.0.1",
"nativescript-oauth": "^2.0.1",
"nativescript-permissions": "^1.2.3",
"nativescript-phone": "^1.3.1",
"nativescript-pro-ui": "3.2.0",
"nativescript-push-notifications": "^1.1.0",
"nativescript-socket.io": "^0.9.0",
"nativescript-status-bar": "^1.1.1",
"nativescript-theme-core": "1.0.4",
"path": "^0.12.7",
"reflect-metadata": "0.1.10",
"rxjs": "5.5.2",
"tns-core-modules": "^3.4.0",
"zone.js": "0.8.18"

Few facts:

  1. With socket.io i have updates being sent to client every 300ms
  2. Geolocation is on constant watch, with options of {desiredAccuracy: Accuracy.high, updateDistance: 0.1, updateTime: 700, minimumUpdateTime: 100, maximumAge: 3000, timeout: 4000, iosAllowsBackgroundLocationUpdates: true}
  3. push plugin has default definitions

In your experience, what are the best definitions for the geolocation watch options, in case I want the user to see his location in realtime?