title: Location Aware Client Library in android
body: <p>I am trying to build a client library in android for communicating with a remote server's API.
  the library utilized AsyncTasks for the communications , the API requires the device location so i need to access google location services from this library.</p>
  
  <pre><code>public class ClientLib{
  
      private Context context;
      public ClientLib(Context c){
           context = c;
      }
  
      ... Lots of methods and nested classes ...
  }
  </code></pre>
  
  <p>in all of the examples i have seen , the google location services is implemented inside of an activity. i tried copying the code to the library and replacing <code>this</code> with <code>context</code> and so forth but it seems like i am missing something.</p>
  
  <p>How would you implement a location aware client library that communicates with a remote API ?</p>