title: Keeping a GPS service alive and optimizing battery life
body: <p>I must build an application with a GPS tracker running during about a day. I'm aware of similar questions in SO but I haven't found any answers to some questions I have.</p>
  
  <p>-I need a GPS fix every 10 min, so I think the best way to do it is to start the location service, get a fix (or timeout) and stop the service (with <code>removeUpdates()</code>). How can I have an application (or service or whatever) running this cycle every 10min and be sure it will continue as long as there is some battery left (even if device goes to sleep, it should wake it up every 10min to get a fix)? Is using AlarmManager a good idea?</p>
  
  <p>-Can I expect the battery to last one day with this method?</p>
  
  <p>I've checked <a href="http://code.google.com/p/mytracks/" rel="nofollow">mytracks</a> but the gps listener seems always on and the battery is expected to last no more than 5h.</p>
  
  <p>I've also checked <a href="https://github.com/commonsguy/cwac-locpoll" rel="nofollow">CWAC Location Poller</a> but it does only <code>removeUpdates()</code> on timeout and restart the listener immediately. It also uses a wakelock while in my case I think an AlarmManager could be a better idea.</p>
  
  <p>Any help/suggestion welcome</p>