GeocoderProxypublic 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 boolean | bind()
return mServiceWatcher.start();
| public static com.android.server.location.GeocoderProxy | createAndBind(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.String | getConnectedPackageName()
return mServiceWatcher.getBestPackageName();
| public java.lang.String | getFromLocation(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.String | getFromLocationName(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.IGeocodeProvider | getService()
return IGeocodeProvider.Stub.asInterface(mServiceWatcher.getBinder());
|
|