0

How to get the phone coordinates or country where is located at the moment in the moment you create your activity ? Tried several methods, but all require a delay/callback and if the device has good performance it returns null most of the time. Is it possible ?

test
  • 13
  • 7

1 Answers1

0

Well, you can get a country code from your configuration like showed here https://stackoverflow.com/a/3660245/3061577

Probably the best and the most clearest way to get coordinates would be to use GPS location as showed here How to get current location in Android

Additionaly, if you are using Google Play Services then there's a guide in Android documentation here http://developer.android.com/training/location/retrieve-current.html

Community
  • 1
  • 1
Gerrerth
  • 63
  • 1
  • 4