Reputation: 309
In my app I am going to use the GPS for getting direction when I am trying to use GPS system. on that time my mobile % of charger will reduce immediately, if there is any idea for overcome from in this issue.
Upvotes: 1
Views: 216
Reputation: 7439
You have to tell what you have done to make the battery consumption so high. (Not even clear if battery becomes 77% after 1 minute or 15 minutes or 1 hr).
How are you accessing GPS? Are you running a handler/thread to periodically poll the GPS. If yes, this is wrong approach. You can ask Android to inform you on location changes.
GPS services are usually memory hungry. Do you need GPS services or just looking for location updates? Android comes with a good startup doco for location based services . http://developer.android.com/guide/topics/location/obtaining-user-location.html Try following the steps in this doco to find best user location.
Make sure to stop listening for updates at the appropriate time. Users will not be happy that one app tries to drain the battery even when it is not running.
Try making the app as a background task.. i.e a Service or BroadcastReceiver
Upvotes: 2