Get current location address for android app

后端 未结 3 1976
长发绾君心
长发绾君心 2020-12-13 00:42

I do not need to display a map. However, I need to use the gps/3g network to locate my current positions ADDRESS (not long and lat) this will then be added to a automated s

3条回答
  •  伪装坚强ぢ
    2020-12-13 01:38

    As you know for getting location address you can use google GeoCoder

    beside that for get location addresses by providing latitude and longitude you can use this API.this is reliable and more faster than google Geocoder.Here i attach the link and small example...

    API url -

    https://maps.googleapis.com/maps/api/geocode/json?latlng=

    you can concatenate latitude and longitude value next to equal sign at the url.

    example -

    lat = 6.123456

    lng = 79.123456

    String url =

    "https://maps.googleapis.com/maps/api/geocode/json?latlng=lat+","+lng";

    this will return a nice jsonObject and you can play with it, just try this.Currently im using this API for my location services and its more faster than normal google geoCoder API.To catch the json response you can use volley or anything.Happy coding.

提交回复
热议问题