locationRequest = new LocationRequest(); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(UPDATE_INTERVAL); locationRequest.setFastestInterval(FASTEST_INTERVAL);
@Override public void onConnected(Bundle arg0) { if (lc != null) { try{ lastKnownLocation = lc.getLastLocation(); catch(Exception ex){ /* log error */ } LocationRequest request = new LocationRequest(); request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); request.setFastestInterval(MIN_TIME_BETWEEN_LOCATION_UPDATES); request.setSmallestDisplacement(MIN_DISTANCE_BETWEEN_LOCATION_UPDATES); lc.requestLocationUpdates(request, ll); } }
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(30 * 1000); locationRequest.setFastestInterval(5 * 1000); LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(locationRequest);
locationRequest.setFastestInterval(FASTEST_INTERVAL); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
googleApiClient.connect(); LocationRequest locationRequest = LocationRequest.create(); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(30 * 1000); locationRequest.setFastestInterval(5 * 1000); LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(locationRequest);
mLocationRequest.setInterval(10); mLocationRequest.setFastestInterval(10); mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequest.setInterval(30 * 1000); mLocationRequest.setFastestInterval(5 * 1000);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequest.setInterval(30 * 1000); mLocationRequest.setFastestInterval(5 * 1000);
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(30 * 1000); locationRequest.setFastestInterval(5 * 1000); LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(locationRequest);
mLocationRequest.setInterval(10); mLocationRequest.setFastestInterval(10); mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
mLocationRequest.setInterval(5000); //5 seconds mLocationRequest.setFastestInterval(3000); //3 seconds mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
public void onConnected(Bundle bundle) { mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(1000); mLocationRequest.setFastestInterval(1000); mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(10000); locationRequest.setFastestInterval(10000 / 2);
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(30 * 1000); locationRequest.setFastestInterval(5 * 1000); LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(locationRequest);
mLocationRequest.setInterval(5000); //5 seconds mLocationRequest.setFastestInterval(3000); //3 seconds mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
LocationRequest mLocationRequest = LocationRequest.create(); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequest.setInterval(Util.UPDATE_INTERVAL_IN_MILLISECONDS); mLocationRequest.setFastestInterval(Util.FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS); }
/** * Private helper method used to generate a LocationRequest which will be used to handle all location updates * within the FusedLocationApi until the Interval is changed. * * @return locationRequest */ private LocationRequest buildLocationRequest() { int dateConversion = 1000; LocationRequest locationRequest = LocationRequest.create(); locationRequest.setInterval(mIntentInterval * dateConversion); locationRequest.setFastestInterval((mIntentInterval / 2) * dateConversion); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); Log.w(TAG, "Building location request"); return locationRequest; }
private LocationRequest mLocationRequest; private static final long INTERVAL = 1000 * 1000; private static final long FASTEST_INTERVAL = 1000 * 900; @Override public void onConnected(Bundle bundle) { mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(INTERVAL); mLocationRequest.setFastestInterval(FASTEST_INTERVAL); mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); }
@Override public void onConnected(Bundle connectionHint) { LocationRequest request = new LocationRequest(); request.setInterval(10000); request.setFastestInterval(5000); request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); // using fused location api, taking care of all // available providers (e.g. GPS, NETWORK) // here do not forget to check for available LOCATION // permission before asking for updates LocationServices.FusedLocationApi.requestLocationUpdates( mGoogleApiClient, request, this); }
LocationRequest mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(INTERVAL); mLocationRequest.setFastestInterval(FASTEST_INTERVAL); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);