Question

I am working on an app that runs a service that has a location listener, and needs to do things in the background.

I am currently integrating Google Maps in my app, do I need to create a different location listener? Do I use the same one, how?

If someone can point me in the right direction for the right way to do it, I would greatly appreciate it...

Was it helpful?

Solution

If you are using google maps v2 just set setMyLocationEnabled(boolean) to true and it will display your location without you having to do anything

OTHER TIPS

In your location Listener, wherever you get your location, you use the googleMaps change position method call.

 googleMap.moveCamera(CameraUpdateFactory.newLatLng(position));

position would be instantiated like so:

 LatLng position = new LatLng(location.getLatitude(), location.getLongitude());

That should do what you want it to do. Spend some time looking at the developer guide for google maps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top