<string name="nocalendar">Нет календаря с именем</string>
<string name="noevents">Нет записей за последнюю неделю</string>
<string name="autherror">Ошибка авторизации</string>
+ <string name="connecterror">Нет связи с сервером через Интернет</string>
<string name="myname">Женя</string>
<string name="registered">отмечено</string>
<string name="last_call">Последний звонок</string>
public MyAccessProtectedResource accessProtectedResource;
public String authErrorMessage;
+ public String connectErrorMessage;
public APIBase(final Resources res, final PersistentStore store) {
this.res = res;
ClientCredentials.CLIENT_SECRET,
token.refreshToken);
authErrorMessage = res.getString(R.string.autherror);
+ connectErrorMessage = res.getString(R.string.connecterror);
enableLogging();
}
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());
import org.average.whereami.SayWhen;
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());