Unknown error for reverese geocoding
<p>this are the error i get.</p>

<pre><code>11-06 16:35:37.206: E/Netd(32): Unable to bind netlink socket: No such file or directory
11-06 16:35:37.206: E/Netd(32): Unable to open quota2 logging socket
11-06 16:37:16.196: E/PhonePolicy(36): Could not preload class for phone policy: com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback
11-06 16:37:48.186: E/BatteryService(100): usbOnlinePath not found`enter code here`
11-06 16:37:48.186: E/BatteryService(100): batteryVoltagePath not found
11-06 16:37:48.186: E/BatteryService(100): batteryTemperaturePath not found
11-06 16:37:49.586: E/StrictMode(100): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
11-06 16:37:49.586: E/StrictMode(100): java.lang.Throwable: Explicit termination method 'close' not called
11-06 16:37:49.586: E/StrictMode(100):  at dalvik.system.CloseGuard.open(CloseGuard.java:184)
11-06 16:37:49.586: E/StrictMode(100):  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:90)
11-06 16:37:49.586: E/StrictMode(100):  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:73)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.UserManager.writeUserList(UserManager.java:202)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.UserManager.fallbackToSingleUser(UserManager.java:153)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.UserManager.readUserList(UserManager.java:109)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.UserManager.&lt;init&gt;(UserManager.java:81)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.UserManager.&lt;init&gt;(UserManager.java:85)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.PackageManagerService.&lt;init&gt;(PackageManagerService.java:923)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:833)
11-06 16:37:49.586: E/StrictMode(100):  at com.android.server.ServerThread.run(SystemServer.java:163)
11-06 16:37:49.686: E/StrictMode(100): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
11-06 16:37:49.686: E/StrictMode(100): java.lang.Throwable: Explicit termination method 'close' not called
11-06 16:37:49.686: E/StrictMode(100):  at dalvik.system.CloseGuard.open(CloseGuard.java:184)
11-06 16:37:49.686: E/StrictMode(100):  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:90)
11-06 16:37:49.686: E/StrictMode(100):  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:73)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.UserManager.writeUser(UserManager.java:167)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.UserManager.fallbackToSingleUser(UserManager.java:154)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.UserManager.readUserList(UserManager.java:109)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.UserManager.&lt;init&gt;(UserManager.java:81)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.UserManager.&lt;init&gt;(UserManager.java:85)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.PackageManagerService.&lt;init&gt;(PackageManagerService.java:923)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:833)
11-06 16:37:49.686: E/StrictMode(100):  at com.android.server.ServerThread.run(SystemServer.java:163)
11-06 16:39:51.976: E/SoundPool(100): error loading /system/media/audio/ui/Lock.ogg
11-06 16:39:51.976: E/SoundPool(100): error loading /system/media/audio/ui/Unlock.ogg
11-06 16:39:52.257: E/EventHub(100): could not get driver version for /dev/input/mouse0, Not a typewriter
11-06 16:39:52.257: E/EventHub(100): could not get driver version for /dev/input/mice, Not a typewriter
11-06 16:39:53.046: E/CommandListener(32): Failed to open /proc/sys/net/ipv6/conf/wlan0/disable_ipv6: No such file or directory
11-06 16:39:53.086: E/WifiStateMachine(100): Failed to disable IPv6: java.lang.IllegalStateException: Unable to communicate to native daemon for disabling ipv6
11-06 16:39:53.308: E/MobileDataStateTracker(100): default: Ignoring feature request because could not acquire PhoneService
11-06 16:39:53.308: E/MobileDataStateTracker(100): default: Could not enable APN type "default"
11-06 16:40:33.376: E/ThrottleService(100): Error reading data file
11-06 16:40:56.507: E/ActivityThread(264): Failed to find provider info for com.android.inputmethod.latin.dictionarypack
11-06 16:40:56.546: E/BinaryDictionaryGetter(264): Could not find a dictionary pack
11-06 16:41:20.624: E/ActivityManager(100): act=com.google.android.location.internal.ANDROID_NLPLoad: 4.27 / 1.97 / 0.81
11-06 16:41:20.624: E/ActivityManager(100): CPU usage from 0ms to 16699ms later:
11-06 16:41:20.624: E/ActivityManager(100):   27% 100/system_server: 18% user + 9.3% kernel / faults: 1929 minor
11-06 16:41:20.624: E/ActivityManager(100):   27% 35/surfaceflinger: 24% user + 2.5% kernel / faults: 1 minor
11-06 16:41:20.624: E/ActivityManager(100):   11% 344/android.process.acore: 9.2% user + 1.8% kernel / faults: 3436 minor
11-06 16:41:20.624: E/ActivityManager(100):   8.8% 249/com.android.systemui: 7.3% user + 1.5% kernel / faults: 2260 minor 3 major
11-06 16:41:20.624: E/ActivityManager(100):   6.4% 66/bootanimation: 5.9% user + 0.4% kernel
11-06 16:41:20.624: E/ActivityManager(100):   4.5% 277/com.android.phone: 3.3% user + 1.1% kernel / faults: 924 minor
11-06 16:41:20.624: E/ActivityManager(100):   3.4% 324/com.google.process.gapps: 2.4% user + 0.9% kernel / faults: 1195 minor
11-06 16:41:20.624: E/ActivityManager(100):   2.3% 289/com.android.settings: 0.9% user + 1.3% kernel / faults: 502 minor
11-06 16:41:20.624: E/ActivityManager(100):   1.8% 44/adbd: 0% user + 1.8% kernel
11-06 16:41:20.624: E/ActivityManager(100):   0.9% 264/com.android.inputmethod.latin: 0.5% user + 0.3% kernel / faults: 329 minor
11-06 16:41:20.624: E/ActivityManager(100):   0.5% 82/logcat: 0.1% user + 0.4% kernel
11-06 16:41:20.624: E/ActivityManager(100):   0% 37/mediaserver: 0% user + 0% kernel / faults: 5 minor
11-06 16:41:20.624: E/ActivityManager(100):   0.2% 36/zygote: 0% user + 0.2% kernel / faults: 69 minor
11-06 16:41:20.624: E/ActivityManager(100):   0% 1//init: 0% user + 0% kernel / faults: 1 minor
11-06 16:41:20.624: E/ActivityManager(100):   0.1% 29/servicemanager: 0% user + 0.1% kernel
11-06 16:41:20.624: E/ActivityManager(100):   0% 34/rild: 0% user + 0% kernel / faults: 2 minor
11-06 16:41:20.624: E/ActivityManager(100):   0% 38/installd: 0% user + 0% kernel / faults: 6 minor
11-06 16:41:20.624: E/ActivityManager(100):  +0% 366/com.android.sdksetup: 0% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100): 100% TOTAL: 75% user + 24% kernel + 0.2% irq + 0.3% softirq
11-06 16:41:20.624: E/ActivityManager(100): CPU usage from 13555ms to 15166ms later:
11-06 16:41:20.624: E/ActivityManager(100):   33% 100/system_server: 29% user + 4.3% kernel / faults: 166 minor
11-06 16:41:20.624: E/ActivityManager(100):     8.6% 101/GC: 8.6% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):     7.9% 115/ActivityManager: 5.7% user + 2.1% kernel
11-06 16:41:20.624: E/ActivityManager(100):     7.9% 343/Binder Thread #: 7.9% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):     2.8% 107/Compiler: 2.1% user + 0.7% kernel
11-06 16:41:20.624: E/ActivityManager(100):     2.8% 114/er.ServerThread: 2.8% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):     0.7% 389/Error dump: sys: 0.7% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):   19% 35/surfaceflinger: 18% user + 1.2% kernel
11-06 16:41:20.624: E/ActivityManager(100):     18% 63/SurfaceFlinger: 18% user + 0.6% kernel
11-06 16:41:20.624: E/ActivityManager(100):     0.6% 35/surfaceflinger: 0% user + 0.6% kernel
11-06 16:41:20.624: E/ActivityManager(100):     0.6% 69/Binder Thread #: 0% user + 0.6% kernel
11-06 16:41:20.624: E/ActivityManager(100):     0.6% 136/Binder Thread #: 0% user + 0.6% kernel
11-06 16:41:20.624: E/ActivityManager(100):   20% 249/com.android.systemui: 18% user + 1.6% kernel / faults: 15 minor 1 major
11-06 16:41:20.624: E/ActivityManager(100):     13% 249/ndroid.systemui: 12% user + 0.8% kernel
11-06 16:41:20.624: E/ActivityManager(100):     3.2% 251/GC: 2.4% user + 0.8% kernel
11-06 16:41:20.624: E/ActivityManager(100):   13% 344/android.process.acore: 13% user + 0% kernel / faults: 101 minor
11-06 16:41:20.624: E/ActivityManager(100):     16% 355/Binder Thread #: 15% user + 1% kernel
11-06 16:41:20.624: E/ActivityManager(100):     1% 351/Compiler: 1% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):   7.1% 66/bootanimation: 7.1% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):     6.4% 68/BootAnimation: 6.4% user + 0% kernel
11-06 16:41:20.624: E/ActivityManager(100):   0.6% 1//init: 0% user + 0.6% kernel
11-06 16:41:20.624: E/ActivityManager(100): 100% TOTAL: 88% user + 10% kernel + 0.6% irq
11-06 16:41:34.184: E/SoundPool(100): error loading /system/media/audio/ui/Effect_Tick.ogg
11-06 16:41:34.184: E/SoundPool(100): error loading /system/media/audio/ui/Effect_Tick.ogg
11-06 16:41:34.285: E/SoundPool(100): error loading /system/media/audio/ui/Effect_Tick.ogg
11-06 16:41:34.285: E/SoundPool(100): error loading /system/media/audio/ui/Effect_Tick.ogg
11-06 16:41:34.285: E/SoundPool(100): error loading /system/media/audio/ui/Effect_Tick.ogg
11-06 16:41:34.294: E/SoundPool(100): error loading /system/media/audio/ui/KeypressStandard.ogg
11-06 16:41:34.294: E/SoundPool(100): error loading /system/media/audio/ui/KeypressSpacebar.ogg
11-06 16:41:34.294: E/SoundPool(100): error loading /system/media/audio/ui/KeypressDelete.ogg
11-06 16:41:34.294: E/SoundPool(100): error loading /system/media/audio/ui/KeypressReturn.ogg
11-06 16:41:40.074: E/ActivityThread(440): Failed to find provider info for com.android.inputmethod.latin.dictionarypack
11-06 16:41:40.104: E/BinaryDictionaryGetter(440): Could not find a dictionary pack
11-06 16:41:40.823: A/NetworkStats(100): problem reading network stats
11-06 16:41:40.823: A/NetworkStats(100): java.lang.IllegalStateException: problem parsing idx 1
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:300)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1282)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:831)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:743)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:721)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.access$000(NetworkStatsService.java:128)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService$8.handleMessage(NetworkStatsService.java:1633)
11-06 16:41:40.823: A/NetworkStats(100):    at android.os.Handler.dispatchMessage(Handler.java:95)
11-06 16:41:40.823: A/NetworkStats(100):    at android.os.Looper.loop(Looper.java:137)
11-06 16:41:40.823: A/NetworkStats(100):    at android.os.HandlerThread.run(HandlerThread.java:60)
11-06 16:41:40.823: A/NetworkStats(100): Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
11-06 16:41:40.823: A/NetworkStats(100):    at libcore.io.IoBridge.open(IoBridge.java:406)
11-06 16:41:40.823: A/NetworkStats(100):    at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:78)
11-06 16:41:40.823: A/NetworkStats(100):    at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:269)
11-06 16:41:40.823: A/NetworkStats(100):    ... 9 more
11-06 16:41:40.823: A/NetworkStats(100): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-06 16:41:40.823: A/NetworkStats(100):    at libcore.io.Posix.open(Native Method)
11-06 16:41:40.823: A/NetworkStats(100):    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-06 16:41:40.823: A/NetworkStats(100):    at libcore.io.IoBridge.open(IoBridge.java:390)
11-06 16:41:40.823: A/NetworkStats(100):    ... 11 more
11-06 16:41:51.994: E/dalvikvm(423): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
11-06 16:42:03.944: E/ThrottleService(100): Error reading data file
11-06 16:42:03.994: A/NetworkStats(100): problem reading network stats
11-06 16:42:03.994: A/NetworkStats(100): java.lang.IllegalStateException: problem parsing idx 1
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:300)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1282)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:831)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:743)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:721)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService.access$000(NetworkStatsService.java:128)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.server.net.NetworkStatsService$1.onReceive(NetworkStatsService.java:612)
11-06 16:42:03.994: A/NetworkStats(100):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
11-06 16:42:03.994: A/NetworkStats(100):    at android.os.Handler.handleCallback(Handler.java:605)
11-06 16:42:03.994: A/NetworkStats(100):    at android.os.Handler.dispatchMessage(Handler.java:92)
11-06 16:42:03.994: A/NetworkStats(100):    at android.os.Looper.loop(Looper.java:137)
11-06 16:42:03.994: A/NetworkStats(100):    at android.os.HandlerThread.run(HandlerThread.java:60)
11-06 16:42:03.994: A/NetworkStats(100): Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
11-06 16:42:03.994: A/NetworkStats(100):    at libcore.io.IoBridge.open(IoBridge.java:406)
11-06 16:42:03.994: A/NetworkStats(100):    at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:78)
11-06 16:42:03.994: A/NetworkStats(100):    at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:269)
11-06 16:42:03.994: A/NetworkStats(100):    ... 11 more
11-06 16:42:03.994: A/NetworkStats(100): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-06 16:42:03.994: A/NetworkStats(100):    at libcore.io.Posix.open(Native Method)
11-06 16:42:03.994: A/NetworkStats(100):    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-06 16:42:03.994: A/NetworkStats(100):    at libcore.io.IoBridge.open(IoBridge.java:390)
11-06 16:42:03.994: A/NetworkStats(100):    ... 13 more
11-06 16:42:10.074: E/ActivityManager(100): Load: 7.19 / 3.07 / 1.24
11-06 16:42:10.074: E/ActivityManager(100): CPU usage from 1677ms to -8025ms ago:
11-06 16:42:10.074: E/ActivityManager(100):   48% 100/system_server: 32% user + 16% kernel / faults: 1076 minor
11-06 16:42:10.074: E/ActivityManager(100):   6.3% 277/com.android.phone: 4.2% user + 2% kernel / faults: 227 minor
11-06 16:42:10.074: E/ActivityManager(100):   2.5% 526/com.android.contacts: 1.7% user + 0.8% kernel / faults: 875 minor
11-06 16:42:10.074: E/ActivityManager(100):   3% 423/com.android.launcher: 1.8% user + 1.2% kernel / faults: 121 minor
11-06 16:42:10.074: E/ActivityManager(100):   2.6% 496/com.android.providers.calendar: 2% user + 0.6% kernel / faults: 212 minor
11-06 16:42:10.074: E/ActivityManager(100):   1.1% 249/com.android.systemui: 0.8% user + 0.3% kernel / faults: 82 minor
</code></pre>

<p>I got four codes main.java, geocoder.java, GoogleReverseGeocodeXmlHandler.java and Utilities.java</p>

<pre><code>package sg.edu.np.BasicUILab;


import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import android.location.Location;


public class Geocoder
{


    public static String reverseGeocode(Location loc)
      {
          //http://maps.google.com/maps/geo?q=40.714224,-73.961452&amp;output=json&amp;oe=utf8&amp;sensor=true_or_false&amp;key=your_api_key
          String localityName = "";
          HttpURLConnection connection = null;
          URL serverAddress = null;

          try
          {
              // build the URL using the latitude &amp; longitude you want to lookup
              // NOTE: I chose XML return format here but you can choose something else
              serverAddress = new URL("http://maps.google.com/maps/geo?q=" + Double.toString(loc.getLatitude()) + "," + Double.toString(loc.getLongitude()) +
                          "&amp;output=xml&amp;oe=utf8&amp;sensor=true&amp;key=" + R.string.GOOGLE_MAPS_API_KEY);
              //set up out communications stuff
              connection = null;

              //Set up the initial connection
              connection = (HttpURLConnection)serverAddress.openConnection();
              connection.setRequestMethod("GET");
              connection.setDoOutput(true);
              connection.setReadTimeout(10000);

              connection.connect();

              try
              {
                  InputStreamReader isr = new InputStreamReader(connection.getInputStream());
                  InputSource source = new InputSource(isr);
                  SAXParserFactory factory = SAXParserFactory.newInstance();
                  SAXParser parser = factory.newSAXParser();
                  XMLReader xr = parser.getXMLReader();
                  GoogleReverseGeocodeXmlHandler handler = new GoogleReverseGeocodeXmlHandler();

                  xr.setContentHandler(handler);
                  xr.parse(source);

                  localityName = handler.getLocalityName();
              }
              catch (Exception ex)
              {
                  ex.printStackTrace();
              }

          }
          catch (Exception ex)
          {
              ex.printStackTrace();
          }

          return localityName;
      }

}


    package sg.edu.np.BasicUILab;



    import android.app.Activity;
    import android.app.ProgressDialog;
    import android.content.Context;
    import android.location.Location;
    import android.location.LocationListener;
    import android.location.LocationManager;
    import android.os.AsyncTask;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.TextView;
    import android.widget.Toast;

    public class Main extends Activity
    {
        private LocationManager locationManager;
        private Location currentLocation;
        private TextView txtLatitude;
        private TextView txtLongitude;
        private Button btnReverseGeocode;


        @Override
       public void onCreate(Bundle savedInstanceState) 
       {
               super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
        this.txtLatitude = (TextView) findViewById(R.id.txtLatitude);
        this.txtLongitude = (TextView) findViewById(R.id.txtLongitude);
        this.btnReverseGeocode = (Button) findViewById(R.id.btnReverseGeocode);

        // Subscribe to our button's click event
        this.btnReverseGeocode.setOnClickListener(
            new OnClickListener() 
            {
                public void onClick(View v)
                {
                    handleReverseGeocodeClick();
                }
            }
             );
        this.locationManager =(LocationManager) getSystemService(Context.LOCATION_SERVICE);

            // Subscribe to the location manager's updates on the current location
            this.locationManager.requestLocationUpdates("gps", (long)30000, (float) 50.0, new LocationListener()
                {

                    public void onLocationChanged(Location arg0) {
                        handleLocationChanged(arg0);


                    }


                    public void onProviderDisabled(String arg0) {
                        // TODO Auto-generated method stub

                    }


                    public void onProviderEnabled(String arg0) {
                        // TODO Auto-generated method stub

                    }


                    public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
                        // TODO Auto-generated method stub

                    }

                });

         }
       private void handleLocationChanged(Location loc)
       {
           // Save the latest location
           this.currentLocation = loc;
           // Update the latitude &amp; longitude TextViews
           this.txtLatitude.setText(Double.toString(loc.getLatitude()));
           this.txtLongitude.setText(Double.toString(loc.getLongitude()));
       }

       private void handleReverseGeocodeClick()
       {
           if (this.currentLocation != null)
           {
               // Kickoff an asynchronous task to fire the reverse geocoding
               // request off to google
               ReverseGeocodeLookupTask task = new ReverseGeocodeLookupTask();
               task.applicationContext = this;
               task.execute();
           }
           else
           {
               // If we don't know our location yet, we can't do reverse
               // geocoding - display a please wait message
               showToast("Please wait until we have a location fix from the gps");
           }
       }
        public void showToast(CharSequence message)    
        {       
            int duration = Toast.LENGTH_SHORT;      
            Toast toast = Toast.makeText(getApplicationContext(), message, duration);   
            toast.show();   
        }

       public class ReverseGeocodeLookupTask extends AsyncTask &lt;Void, Void, String&gt;
       {
           private ProgressDialog dialog;
           protected Context applicationContext;
           @Override
           protected void onPreExecute()
           {
               this.dialog = ProgressDialog.show(applicationContext, "Please wait...contacting the tubes.",
                       "Requesting reverse geocode lookup", true);
           }
           @Override
           protected String doInBackground(Void... params)
           {
               String localityName = "";

               if (currentLocation != null)
               {
                   localityName = Geocoder.reverseGeocode(currentLocation);
               }

               return localityName;
           }
           @Override
           protected void onPostExecute(String result)
           {
               this.dialog.cancel();
               Utilities.showToast("Your Locality is: " + result, applicationContext);
           }
       }
    }
    package sg.edu.np.BasicUILab;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    public class GoogleReverseGeocodeXmlHandler extends DefaultHandler
    {
         private boolean inLocalityName = false;
            private boolean finished = false;
            private StringBuilder builder;
            private String localityName;

            public String getLocalityName()
            {
                return this.localityName;
            }
            @Override
            public void characters(char[] ch, int start, int length)
                   throws SAXException {
                super.characters(ch, start, length);
                if (this.inLocalityName &amp;&amp; !this.finished)
                {
                    if ((ch[start] != '\n') &amp;&amp; (ch[start] != ' '))
                    {
                        builder.append(ch, start, length);
                    }
                }
            }
            @Override
            public void endElement(String uri, String localName, String name)
                    throws SAXException
            {
                super.endElement(uri, localName, name);

                if (!this.finished)
                {
                    if (localName.equalsIgnoreCase("LocalityName"))
                    {
                        this.localityName = builder.toString();
                        this.finished = true;
                    }

                    if (builder != null)
                    {
                        builder.setLength(0);
                    }
                }
            }

            @Override
            public void startDocument() throws SAXException
            {
                super.startDocument();
                builder = new StringBuilder();
            }

            @Override
            public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException
            {
                super.startElement(uri, localName, name, attributes);

                if (localName.equalsIgnoreCase("LocalityName"))
                {
                    this.inLocalityName = true;
                }
            }
    }
    package sg.edu.np.BasicUILab;
    import android.content.Context;
    import android.widget.Toast;
    public class Utilities 
    {
        public static void showToast(CharSequence message, Context appContext)   
        {       
            int duration = Toast.LENGTH_SHORT;      
            Toast toast = Toast.makeText(appContext, message, duration);        
            toast.show();  
        }
    }
</code></pre>
