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,386
  • 4
  • 39
  • 68
Somk
  • 11,579
  • 30
  • 94
  • 139

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
  • 261
  • 3
  • 23