0

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 ?

user47376
  • 2,263
  • 3
  • 21
  • 26

1 Answers1

0

I don't understand the question but are you trying to get location notifications (lat and lng) from an Android Service and call an API with this retrieved values? Something like THIS?

Community
  • 1
  • 1
Juan Saravia
  • 7,661
  • 6
  • 29
  • 41