0
I’m creating an app on Android (with Android Studio) of Shopping. The idea is to register a purchase in the app that the user has performed. What I wanted is at the time we do that catch the latitude and longitude from where it is.
You asked what class and method I use for this on Android?
I mean Android 5, 6 up.
http://stackoverflow.com/a/2227299/3792998
– jsantos1991
Just remember, if the SDK you are using to compile is greater than API 23 (Android 6.0) you must enter the permissions at runtime, you can find details here
– Marco Giovanni
@Marcogiovanni on Android 6 all need to ask in Run Time? (permissions)
– Luhhh
@Luizach Yes, but depending on your case you don’t need to use API 23 or higher to compile, if you compile with API 22 (Android 5.1.1), when your app is installed on android 6.0 or higher, the permissions will already be automatically enabled, this image demonstrates this
– Marco Giovanni
@Luizach I published an answer here on the question: "The location obtained by getLastLocation() always returns null", which will be useful to you.
– viana
best starting point is always the documentation
– Neuber Oliveira