-3

I want to show a continuous update of Lat and long along with location address .

I was able to receive continuous lat/lng but wasn't able to find the location address .

Basically , want to combine these two : https://developer.android.com/training/location/receive-location-updates.html

https://developer.android.com/training/location/display-address.html

How can I achieve this?

Thanks.

delhi_123
  • 39
  • 1
  • 9
  • *How can I achieve this?* as usual: CTRL+C, CTRL+V – Selvin Jul 16 '15 at 09:15
  • Off the top of my head, use the lat/long that you continuously receive and follow the instructions in link #2 to get the address. – Matter Cat Jul 16 '15 at 09:16
  • @Selvin: i did , still not ...can u please try this as usual and let me know. it would be great help . – delhi_123 Jul 16 '15 at 09:21
  • @MatterCat: i did it . but following link#2 didnt work and made me confuse – delhi_123 Jul 16 '15 at 09:21
  • @Shipra_delhi you posted 2 good examples ... and you are unable to combine 'em ... what's you expect? a miracle? if you cannot do this by yourself how we can help you? giving a working code? it is not the way how SO works... – Selvin Jul 16 '15 at 09:23
  • @Selvin: i expect you to combine 'em and show me a miracle . SIMPLE . – delhi_123 Jul 16 '15 at 09:24
  • as Matter Cat wrote ... you have to get results from 1st example and pass em to the 2nd example ... this should be simple enough ... – Selvin Jul 16 '15 at 09:26
  • @Selvin : yaar see , i am novice in this and got this project and seeing this example i am really got confuse that's why needed help . That's All . – delhi_123 Jul 16 '15 at 09:27
  • @Selvin ohkay . Will try to pass and see . Thanks – delhi_123 Jul 16 '15 at 09:27

1 Answers1

0

Hi you can get a location address using Geocoder class

Geocoder gcd = new Geocoder(this, Locale.getDefault());

List<Address> addresses;
String city;

try {

    addresses = gcd.getFromLocation(lat,lon, 1);

    if (addresses.size() > 0) 
        city = addresses.get(0).getLocality();

} catch (IOException e) {
    e.printStackTrace();
}
br00
  • 1,391
  • 11
  • 21