Rana
Rana

Reputation: 134

how to Fused location Run in Background service continuously

Hi I want to write Fused location in Service which run in background continuously. where i can write code for send location to server. I have implement it in Activity now i want to implement it in Service.Please help me.

Upvotes: 2

Views: 10133

Answers (1)

Ameer
Ameer

Reputation: 2769

You can extends the Service and implemetns the methods

public class BackgroundLocationService extends Service implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, LocationListener

Check this code for implementation Background location services.

remember just remove your location updates properly. otherwise service will not stop by calling stopService method

Upvotes: 2

Related Questions