How to get the ZIP code from current location(in India) in android?
<p>I need to find zip code for current location in India. Is this possible?</p>

<p>below is the logic for getting the ZIP address</p>

<pre><code>    LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
    List&lt;String&gt; matchingProviders = locationManager.getAllProviders();
    String postalCode = null;
    Geocoder geocoder = null;
    for (String provider: matchingProviders) {
       Location location = locationManager.getLastKnownLocation(provider);
       if (location != null) {
           if (geocoder == null) {
           geocoder = new Geocoder(this);
           }
       try {
         List&lt;Address&gt; addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 100);
        if (addresses != null &amp;&amp; addresses.size() &gt; 0) {
            for (Address address : addresses) {
                postalCode = address.getPostalCode();
            } catch (IOException e) {
                Log.logException("Geocoder error", e);
            }
        }
    }
</code></pre>
