How Do I Implement LocationClient within Intent Service?
You wouldn't. LocationClient
's API is asynchronous, which does not work well with IntentService
. Use a regular Service
, manage your own background thread as needed, and call stopSelf()
when you no longer need the service.
The problem is that a new instance of Location Client is not accepting context or context.getApplicationContext() as parameters for ConnectionCallbacks and ConnectionFailedListner.
You have to pass in implementations of those listener interfaces.
GooglePlayServicesClient.ConnectionCallbacks and GooglePlayServicesClient.OnConnectionFailedListener are implemented with their accompanying methods
Not on Context
and not on Application
. You did not write those classes -- Google did. You cannot implement those interfaces on those classes as a result.
Somewhere, perhaps, you did implement those interfaces, in which case you need to pass an instance of that object (or objects, plural) to the appropriate methods.