Android location update problem
<p>I am working on one application in android and in my application i need to send the user's exact location to server. I m sending the location to server when i received push notification from the server that location is required.</p>

<p>Here on the onStart Method of Service Class i m calling " </p>

<pre><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MINIMUM_TIME_BETWEEN_UPDATES, MINIMUM_DISTANCE_CHANGE_FOR_UPDATES,new MyLocationListener());"
   "
</code></pre>

<p>to get the updates of user location and i m saving the location into the shared prefrence and when i get the location push notification i m sending the current location from shared prefrence.</p>

<p><strong>Problem:</strong></p>

<ol>
<li>My Gps provider is enabled all the time and consuming lots of battery</li>
<li>How can i save the battery?</li>
<li>I want to send the accurate location of the user?</li>
</ol>

<p>Everything is working fine but battery is consuming.</p>

<p>I want when needed then only it will call location update and after that stop the location update and gives the most accurate location of the user.</p>
