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
  • 3,830
  • 2
  • 27
  • 27
mike_x_
  • 1,840
  • 3
  • 31
  • 68

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
  • 181
  • 1
  • 1
  • 6