# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# Geocoder

`public final class Geocoder`
`extends Object` ``

java.lang.Object
↳ | android.location.Geocoder

A class for handling geocoding and reverse geocoding. Geocoding is the process of transforming a street address or other description of a location into a (latitude, longitude) coordinate. Reverse geocoding is the process of transforming a (latitude, longitude) coordinate into a (partial) address. The amount of detail in a reverse geocoded location description may vary, for example one might contain the full street address of the closest building, while another might contain only a city name and postal code. The Geocoder class requires a backend service that is not included in the core android framework. The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists.

Warning: Geocoding services may provide no guarantees on availability or accuracy. Results are a best guess, and are not guaranteed to be meaningful or correct. Do not use this API for any safety-critical or regulatory compliance purpose.

## Summary

### Public constructors
`Geocoder(Context context, Locale locale)` Constructs a Geocoder whose responses will be localized for the given Locale.
`Geocoder(Context context)` Constructs a Geocoder whose responses will be localized for the default system Locale.

### Public methods
`List<Address>` | `getFromLocation(double latitude, double longitude, int maxResults)` Returns an array of Addresses that attempt to describe the area immediately surrounding the given latitude and longitude.
`List<Address>` | `getFromLocationName(String locationName, int maxResults, double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude, double upperRightLongitude)` Returns an array of Addresses that attempt to describe the named location, which may be a place name such as "Dalvik, Iceland", an address such as "1600 Amphitheatre Parkway, Mountain View, CA", an airport code such as "SFO", and so forth.
`List<Address>` | `getFromLocationName(String locationName, int maxResults)` Returns an array of Addresses that attempt to describe the named location, which may be a place name such as "Dalvik, Iceland", an address such as "1600 Amphitheatre Parkway, Mountain View, CA", an airport code such as "SFO", and so forth.
`static boolean` | `isPresent()` Returns true if the Geocoder methods getFromLocation and getFromLocationName are implemented.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Geocoder

    public Geocoder (Context context,
                    Locale locale)

Constructs a Geocoder whose responses will be localized for the given Locale.

Parameters
`context` | `Context`: the Context of the calling Activity
`locale` | `Locale`: the desired Locale for the query results

Throws
`NullPointerException` | if Locale is null

### Geocoder

    public Geocoder (Context context)

Constructs a Geocoder whose responses will be localized for the default system Locale.

Parameters
`context` | `Context`: the Context of the calling Activity

## Public methods

### getFromLocation

    public List<Address> getFromLocation (double latitude,
                    double longitude,
                    int maxResults)

Returns an array of Addresses that attempt to describe the area immediately surrounding the given latitude and longitude. The returned addresses should be localized for the locale provided to this class's constructor. Results may be obtained by means of a network lookup and this method may take some time to return, and so should not be called on the main thread.

Warning: Geocoding services may provide no guarantees on availability or accuracy. Results are a best guess, and are not guaranteed to be meaningful or correct. Do NOT use this API for any safety-critical or regulatory compliance purposes.

Parameters
`latitude` | `double`: the latitude a point for the search
`longitude` | `double`: the longitude a point for the search
`maxResults` | `int`: max number of addresses to return. Smaller numbers (1 to 5) are recommended

Returns
`List<Address>` | a list of Address objects. Returns null or empty list if no matches were found or there is no backend service available.

Throws
`IllegalArgumentException` | if latitude is less than -90 or greater than 90
`IllegalArgumentException` | if longitude is less than -180 or greater than 180
`IOException` | if the network is unavailable or any other I/O problem occurs

### getFromLocationName

    public List<Address> getFromLocationName (String locationName,
                    int maxResults,
                    double lowerLeftLatitude,
                    double lowerLeftLongitude,
                    double upperRightLatitude,
                    double upperRightLongitude)

Returns an array of Addresses that attempt to describe the named location, which may be a place name such as "Dalvik, Iceland", an address such as "1600 Amphitheatre Parkway, Mountain View, CA", an airport code such as "SFO", and so forth. The returned addresses should be localized for the locale provided to this class's constructor. Results may be obtained by means of a network lookup and this method may take some time to return, and so should not be called on the main thread.

You may specify a bounding box for the search results by including the latitude and longitude of the lower left point and upper right point of the box.

Warning: Geocoding services may provide no guarantees on availability or accuracy. Results are a best guess, and are not guaranteed to be meaningful or correct. Do NOT use this API for any safety-critical or regulatory compliance purposes.

Parameters
`locationName` | `String`: a user-supplied description of a location
`maxResults` | `int`: max number of addresses to return. Smaller numbers (1 to 5) are recommended
`lowerLeftLatitude` | `double`: the latitude of the lower left corner of the bounding box
`lowerLeftLongitude` | `double`: the longitude of the lower left corner of the bounding box
`upperRightLatitude` | `double`: the latitude of the upper right corner of the bounding box
`upperRightLongitude` | `double`: the longitude of the upper right corner of the bounding box

Returns
`List<Address>` | a list of Address objects. Returns null or empty list if no matches were found or there is no backend service available.

Throws
`IllegalArgumentException` | if locationName is null
`IllegalArgumentException` | if any latitude is less than -90 or greater than 90
`IllegalArgumentException` | if any longitude is less than -180 or greater than 180
`IOException` | if the network is unavailable or any other I/O problem occurs

### getFromLocationName

    public List<Address> getFromLocationName (String locationName,
                    int maxResults)

Returns an array of Addresses that attempt to describe the named location, which may be a place name such as "Dalvik, Iceland", an address such as "1600 Amphitheatre Parkway, Mountain View, CA", an airport code such as "SFO", and so forth. The returned addresses should be localized for the locale provided to this class's constructor. Results may be obtained by means of a network lookup and this method may take some time to return, and so should not be called on the main thread.

Warning: Geocoding services may provide no guarantees on availability or accuracy. Results are a best guess, and are not guaranteed to be meaningful or correct. Do NOT use this API for any safety-critical or regulatory compliance purposes.

Parameters
`locationName` | `String`: a user-supplied description of a location
`maxResults` | `int`: max number of results to return. Smaller numbers (1 to 5) are recommended

Returns
`List<Address>` | a list of Address objects. Returns null or empty list if no matches were found or there is no backend service available.

Throws
`IllegalArgumentException` | if locationName is null
`IOException` | if the network is unavailable or any other I/O problem occurs

### isPresent

    public static boolean isPresent ()

Returns true if the Geocoder methods getFromLocation and getFromLocationName are implemented. Lack of network connectivity may still cause these methods to return null or empty lists.

Returns
`boolean` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*