Warning You should use GeoCoder class from Android SDK instead of this.
A simple wrapper to get the location by passing lat/long value to Google Maps Reverse Geocoding.
ReverseGeo reverseGeo = new ReverseGeo("16.780833,96.149722");
// OR
// ReverseGeo reverseGeo = new ReverseGeo(16.780833, 96.149722);
reverseGeo.setType(ReverseGeo.LOCALITY);
reverseGeo.getAsyncShortName(); // returns the short name with locality type
// OR
reverseGeo.getSyncShortName(); // returns the short name with locality typeNote that there are two ways to get the value. One of them is getSyncShortName().
If you use getSyncShortName(), wrap it with AsyncTask .
The available types are
- ROUTE
- NEIGHBORHOOD
- SUBLOCALITY
- LOCALITY
- COUNTRY
Depends on location, the attributes may vary and not be available.
Please see sample for more.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
MIT