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.
public class ClientLib{
private Context context;
public ClientLib(Context c){
context = c;
}
... Lots of methods and nested classes ...
}
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 this
with context
and so forth but it seems like i am missing something.
How would you implement a location aware client library that communicates with a remote API ?