title: What is the simplest and most robust way to get the user's current location on Android?
body: <p>The <code>LocationManager</code> API on Android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location.</p>
  
  <p>The app I'm working on isn't really a location app per se, but it does need to get the user's location in order to display a list of nearby businesses.  It doesn't need to worry about if the user is moving around or anything like that.</p>
  
  <p>Here's what I'd like to do:</p>
  
  <ol>
  <li>Show the user a list of nearby locations.</li>
  <li>Preload the user's location so that by the time I need it in <code>Activity</code> X, it will be available.</li>
  <li>I don't particularly care about accuracy or frequency of update. Just grabbing one location is sufficient as long as it's not way off. Maybe if I want to be fancy I'll update the location once every few mins or so, but it's not a huge priority.</li>
  <li>Work for any device as long as it has either a GPS or a Network Location provider.</li>
  </ol>
  
  <p>It seems like it shouldn't be that hard, but it appears to me that I have to spin up two different location providers (GPS and NETWORK) and manage each's lifecycle. Not only that, but I have to duplicate the same code in multiple activities to satisfy #2. I've tried using <code>getBestProvider()</code> in the past to cut the solution down to just using one location provider, but that seems to only give you the best "theoretical" provider rather than the provider that's actually going to give you the best results.</p>
  
  <p>Is there a simpler way to accomplish this?</p>