0

There are so many old and even more new solutions written to handle the "go to my current location" with Google Maps V2.

I am having trouble finding the correct one that works with the latest permission changes in Android.

I have a google maps app with a custom go to my location button that would:

  • Only uses GPS
  • Works with the latest android permission logic
  • Moves the map to the device location when the above two are fine.

Does someone has a solution that will work now in mid 2016?

Thanks!

KasparTr
  • 2,328
  • 5
  • 26
  • 55

1 Answers1

0

From the documentation of Google Maps Android API, the location data available to an Android device includes the current location of the device pinpointed using a combination of technologies, the direction and method of movement, and whether the device has moved across a predefined geographical boundary, or geofence.

This is the 3 options that you can use with your app.

  • Using My Location layer that provides a simple way to display the device's location on the map. It does not provide data.

  • Using Google Play services Location API is recommended for all programmatic requests for location data.

  • And using the LocationSource interface allows you to provide a custom location provider.

For more information, check this tutorial and related SO question.

Community
  • 1
  • 1
KENdi
  • 7,576
  • 2
  • 16
  • 31