aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-07-30 15:31:43 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-07-30 15:31:43 +0200
commit8dfc859f5418c93a2cd8799d251170ac7b2df8f3 (patch)
treead658c8a4fb6669351b56fe9e4ff3ff9971be888
parentdca4963b93906cf138748d204f5707e9e6b4c756 (diff)
downloadcgeo-8dfc859f5418c93a2cd8799d251170ac7b2df8f3.zip
cgeo-8dfc859f5418c93a2cd8799d251170ac7b2df8f3.tar.gz
cgeo-8dfc859f5418c93a2cd8799d251170ac7b2df8f3.tar.bz2
Initialize Google Play Services
-rw-r--r--main/src/cgeo/geocaching/CgeoApplication.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/CgeoApplication.java b/main/src/cgeo/geocaching/CgeoApplication.java
index 269c1b6..1b3cb05 100644
--- a/main/src/cgeo/geocaching/CgeoApplication.java
+++ b/main/src/cgeo/geocaching/CgeoApplication.java
@@ -8,6 +8,9 @@ import cgeo.geocaching.sensors.IGeoData;
import cgeo.geocaching.utils.Log;
import cgeo.geocaching.utils.OOMDumpingUncaughtExceptionHandler;
+import com.google.android.gms.common.ConnectionResult;
+import com.google.android.gms.common.GooglePlayServicesUtil;
+
import rx.Observable;
import rx.functions.Action1;
import rx.observables.ConnectableObservable;
@@ -28,6 +31,7 @@ public class CgeoApplication extends Application {
private Observable<Status> gpsStatusObservable;
private volatile IGeoData currentGeo = null;
private volatile float currentDirection = 0.0f;
+ private boolean isGooglePlayServicesAvailable = false;
public static void dumpOnOutOfMemory(final boolean enable) {
@@ -66,6 +70,11 @@ public class CgeoApplication extends Application {
}
// ensure initialization of lists
DataStore.getLists();
+ // Check if Google Play services is available
+ if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS) {
+ isGooglePlayServicesAvailable = true;
+ }
+ Log.i("Google Play services are " + (isGooglePlayServicesAvailable ? "" : "not ") + "available");
}
@Override
@@ -144,4 +153,8 @@ public class CgeoApplication extends Application {
forceRelog = true;
}
+ public boolean isGooglePlayServicesAvailable() {
+ return isGooglePlayServicesAvailable;
+ }
+
}