FileDocCategorySizeDatePackage
GeocoderProxy.javaAPI DocAndroid 5.1 API3675Thu Mar 12 22:22:42 GMT 2015com.android.server.location

GeocoderProxy

public class GeocoderProxy extends Object
Proxy for IGeocodeProvider implementations.

Fields Summary
private static final String
TAG
private static final String
SERVICE_ACTION
private final android.content.Context
mContext
private final com.android.server.ServiceWatcher
mServiceWatcher
Constructors Summary
private GeocoderProxy(android.content.Context context, int overlaySwitchResId, int defaultServicePackageNameResId, int initialPackageNamesResId, android.os.Handler handler)

        mContext = context;

        mServiceWatcher = new ServiceWatcher(mContext, TAG, SERVICE_ACTION, overlaySwitchResId,
            defaultServicePackageNameResId, initialPackageNamesResId, null, handler);
    
Methods Summary
private booleanbind()

        return mServiceWatcher.start();
    
public static com.android.server.location.GeocoderProxycreateAndBind(android.content.Context context, int overlaySwitchResId, int defaultServicePackageNameResId, int initialPackageNamesResId, android.os.Handler handler)


        
               
                
        GeocoderProxy proxy = new GeocoderProxy(context, overlaySwitchResId,
            defaultServicePackageNameResId, initialPackageNamesResId, handler);
        if (proxy.bind()) {
            return proxy;
        } else {
            return null;
        }
    
public java.lang.StringgetConnectedPackageName()

        return mServiceWatcher.getBestPackageName();
    
public java.lang.StringgetFromLocation(double latitude, double longitude, int maxResults, android.location.GeocoderParams params, java.util.List addrs)

        IGeocodeProvider provider = getService();
        if (provider != null) {
            try {
                return provider.getFromLocation(latitude, longitude, maxResults, params, addrs);
            } catch (RemoteException e) {
                Log.w(TAG, e);
            }
        }
        return "Service not Available";
    
public java.lang.StringgetFromLocationName(java.lang.String locationName, double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude, double upperRightLongitude, int maxResults, android.location.GeocoderParams params, java.util.List addrs)

        IGeocodeProvider provider = getService();
        if (provider != null) {
            try {
                return provider.getFromLocationName(locationName, lowerLeftLatitude,
                        lowerLeftLongitude, upperRightLatitude, upperRightLongitude,
                        maxResults, params, addrs);
            } catch (RemoteException e) {
                Log.w(TAG, e);
            }
        }
        return "Service not Available";
    
private android.location.IGeocodeProvidergetService()

        return IGeocodeProvider.Stub.asInterface(mServiceWatcher.getBinder());