private boolean servicesConnected() { // Check that Google Play services is available int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(_context.getContext()); if (ConnectionResult.SUCCESS == resultCode) { Log.d("Location Updates", "Google Play services is available."); return true; // Google Play services was not available for some reason } else { OeLog.e("location services connect error: " + resultCode); // tddo: send error via intent } return false; }
@Override public void onCreate() { // Create a new global location parameters object _LocationRequest = LocationRequest.create(); _LocationRequest.setInterval(LocationUtils.UPDATE_INTERVAL_IN_MILLISECONDS); _LocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); _LocationRequest.setFastestInterval(LocationUtils.FAST_INTERVAL_CEILING_IN_MILLISECONDS); /* * Create a new location client, using the enclosing class to * handle callbacks. */ _locationClient = new LocationClient(_context.getContext(), this, this); }
@Override public void onLocationChanged(Location location) { _context.updateLocation(location); }