import java.lang.Math;
import java.io.IOException;
+import java.net.UnknownHostException;
+import org.apache.http.conn.HttpHostConnectException;
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.client.http.HttpResponseException;
} catch (HttpResponseException e) {
Log.e(TAG, "HttpResponseException: " + e);
return new Utterance(false, e.getMessage());
+ } catch (UnknownHostException e) {
+ Log.e(TAG, "UnknownHostException: " + e);
+ return new Utterance(false,
+ base.connectErrorMessage + "\n" +
+ e.getMessage());
+ } catch (HttpHostConnectException e) {
+ Log.e(TAG, "HttpHostConnectException: " + e);
+ return new Utterance(false,
+ base.connectErrorMessage + "\n" +
+ e.getMessage());
} catch (IOException e) {
Log.e(TAG, "IOException: " + e);
return new Utterance(false, e.getMessage());
Double.parseDouble(loc_lats[i]),
Double.parseDouble(loc_lons[i]));
Log.v(TAG, "Dist from " + loc_names[i] +
- " is " + dist);
- if ((loc_dists[i] == "0") ||
+ " is " + dist +
+ ", threshold " + loc_dists[i]);
+ if ((loc_dists[i].equals("0")) ||
(dist < Double.parseDouble(loc_dists[i]))) {
locmsg = loc_names[i];
break;