The app goes beyond just

Reverse geocoding Android app

Here is a full example code using a Thread and a Handler to get the Geocoder answer without blocking the UI.

Geocoder call procedure, can be located in a Helper class

public static void getAddressFromLocation( final Location location, final Context context, final Handler handler) { Thread thread = new Thread { @Override public void run { Geocoder geocoder = new Geocoder(context, Locale.getDefault); String result = null; try { List

list = geocoder.getFromLocation( location.getLatitude, location.getLongitude, 1); if (list != null && list.size > 0) { Address address = list.get(0); // sending back first address line and locality result = address.getAddressLine(0) + ", " + address.getLocality; } } catch (IOException e) { Log.e(TAG, "Impossible to connect to Geocoder", e); } finally { Message msg = Message.obtain; msg.setTarget(handler); if (result != null) { msg.what = 1; Bundle bundle = new Bundle; bundle.putString("address", result); msg.setData(bundle); } else msg.what = 0; msg.sendToTarget; } } }; thread.start; }

Here is the call to this Geocoder procedure in your UI Activity:

getAddressFromLocation(mLastKownLocation, this, new GeocoderHandler);

And the handler to show the results in your UI:

private class GeocoderHandler extends Handler { @Override public void handleMessage(Message message) { String result; switch (message.what) { case 1: Bundle bundle = message.getData; result = bundle.getString("address"); break; default: result = null; } // replace by what you need to do myLabel.setText(result); } }

Don't forget to put the following permission in your

You might also like
Android No-Permissions Reverse Shell
Android No-Permissions Reverse Shell
How to create a simple Google Map app in Android
How to create a simple Google Map app in Android
Barcamp Bangalore 13: Reverse Engineering an Android app
Barcamp Bangalore 13: Reverse Engineering an Android app ...

Doyle Park...just up the street from my

by bikeriderdude

Office on Sonoma Avenue (towards Farmer's Lane).
Be great if you can bring a kid. We'll talk before then, but I'm pretty sure I can get my whole family to come.

7 Game of Thrones Apps That Will Get You Through the Much-awaited Winter  — Gizmodo India
.. or Winterfell, you get a dialog box, which asks you to buy more maps. Unfortunately, you can't dismiss the dialogue box, leading to the obstruction of the cartography. ..

Flagstaff's rocky lava field became a little piece of the moon  — azcentral
If American know-how could put a man on the moon, the man should bring back rocks to study. The government agreed, and in 1963, the .. Volcanoes were chosen because of the moon's volcanic history, the test site for its impact craters.

O'Reilly Media Google Maps Hacks
Book (O'Reilly Media)
  • Used Book in Good Condition

Missing in Alaska without a trace  — Anchorage Daily News
The official version of events, according to a still active missing person's bulletin from the Alaska State Troopers is that Griffis went into the wild "to test out a survival 'cocoon' that he had invented.

No Starch Press Map Scripting 101: An Example-Driven Guide to Building Interactive Maps with Bing, Yahoo!, and Google Maps
eBooks (No Starch Press)
Wrox Professional Android 2 Application Development
Book (Wrox)
Garmin Garmin nuvi 880 4.3-Inch Widescreen Bluetooth Portable GPS Navigator
GPS or Navigation System (Garmin)
  • Sleek, ultra-slim design fits in a pocket; High-sensitivity GPS receiver for fast satellite lock
  • Pre-loaded with City Navigtor NT maps for North America, including more than 6-million name-searchable points of interest
  • Speech recognition -- speak menu options and keep your eyes on the road
  • Multi-destination routing -- enter several destinations and get the best route to all of them; Where am I? and Where s my car? features
  • Full feature set -- text to speech for spoken directions with real street names; MP3 player, and Photo viewer
Related Posts