de.monarchy.guideme.routing.android
Class AndroidGeoCoding

java.lang.Object
  extended by de.monarchy.guideme.routing.android.AndroidGeoCoding
All Implemented Interfaces:
GeoCodingComponent

public class AndroidGeoCoding
extends java.lang.Object
implements GeoCodingComponent

AndroidGeoCoding is a geocoding provider using Android's internal Geocoder implementation. As described there, it is not defined which service is used. The service is synchronous, so the void method is not supported and throws the corresponding exception.

Author:
dstuerze

Field Summary
 
Fields inherited from interface de.monarchy.guideme.routing.GeoCodingComponent
ERROR_NOT_FOUND, ERROR_SERVICE_DOWN, EVERYWHERE
 
Constructor Summary
AndroidGeoCoding(Context x)
          Creates a new GeoCoding component with the given application's context.
 
Method Summary
 void findNear(GeoCodingListener l, java.lang.String search, GeoCoordinate location, int maxDistance)
          Searches places defined by a search string in an area around a certain location.
 PointOfInterest[] findNear(java.lang.String search, GeoCoordinate location, int maxDistance)
          Searches places defined by a search string in an area around a certain location.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndroidGeoCoding

public AndroidGeoCoding(Context x)
Creates a new GeoCoding component with the given application's context.

Parameters:
x - application context
Method Detail

findNear

public PointOfInterest[] findNear(java.lang.String search,
                                  GeoCoordinate location,
                                  int maxDistance)
                           throws java.lang.UnsupportedOperationException
Description copied from interface: GeoCodingComponent
Searches places defined by a search string in an area around a certain location. The method will call a geocoding service and deliver an array of possible matches. The search is restricted to an area near a given location. The maximal distance is denoted by the parameter maxDistance, which can be set to the constant value EVERYWHERE to search without restrictions.

Specified by:
findNear in interface GeoCodingComponent
Parameters:
search - place that is searched
location - location near the place
maxDistance - maximum distance between location and place
Returns:
array of possible matches
Throws:
java.lang.UnsupportedOperationException - if a synchronous call is not supported

findNear

public void findNear(GeoCodingListener l,
                     java.lang.String search,
                     GeoCoordinate location,
                     int maxDistance)
              throws java.lang.UnsupportedOperationException
Description copied from interface: GeoCodingComponent
Searches places defined by a search string in an area around a certain location. The method will call a geocoding service and deliver an array of possible matches. The search is restricted to an area near a given location. The maximal distance is denoted by the parameter maxDistance, which can be set to the constant value EVERYWHERE to search without restrictions. After the call is completed, the given listener receives an answer.

Specified by:
findNear in interface GeoCodingComponent
Parameters:
l - RoutingListener the result is delivered to
search - place that is searched
location - location near the place
maxDistance - maximum distance between location and place
Throws:
java.lang.UnsupportedOperationException - in every case