1

I am trying to create a Service in my application which will provide location to the activities (of the same app, not others) that need it. I would prefer to use Google Play Services

rather than LocationManager.

Could you give me an example of such a Service? Also, how do I start it and how do I get the location from an activity?

f-CJ
  • 4,235
  • 2
  • 30
  • 28
mike_x_
  • 1,900
  • 3
  • 35
  • 69

1 Answers1

0

Try using a singleton to achieve it. I am on the move so could not suggest code. Create an application singleton and use it to create a singleton class where you receive the location. Fetch location from this file.

Ashik Vetrivelu
  • 201
  • 1
  • 2
  • 6