1

I have been able to get the lat and long, but is there a way to then obtain a rough guess on a local postcode?

I need this to work in the UK.

If this is not possible please say so.

Prizoff
  • 4,486
  • 4
  • 41
  • 69
Somk
  • 11,869
  • 32
  • 97
  • 143

1 Answers1

2
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
addresses = geocoder.getFromLocation(latitude, longitude, 1);

Postal code (ZIP code for United States), if available, is:

final String postalCode = addresses.get(0).getPostalCode();

(Found here.)

Community
  • 1
  • 1
QuestionMarks
  • 246
  • 3
  • 24