private void createLocationRequest() {
   locationRequest = new LocationRequest();
   locationRequest.setInterval(interval);
   locationRequest.setFastestInterval(interval / 3);
   locationRequest.setPriority(priority);
   locationRequest.setSmallestDisplacement(minDisplacement);
 }
 /** Creating location request object */
 protected void createLocationRequest() {
   mLocationRequest = new LocationRequest();
   mLocationRequest.setInterval(UPDATE_INTERVAL);
   mLocationRequest.setFastestInterval(FATEST_INTERVAL);
   mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
   mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
 }
Beispiel #3
0
 @Override
 public void onCreate() {
   locationRequest = LocationRequest.create();
   locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
   locationRequest.setInterval(Application.locationUpdateTime);
   if (Application.locationMinDistance > 0) {
     locationRequest.setSmallestDisplacement(Application.locationMinDistance);
   }
   apiClient =
       new GoogleApiClient.Builder(getApplicationContext())
           .addApi(LocationServices.API)
           .addConnectionCallbacks(this)
           .addOnConnectionFailedListener(this)
           .build();
   apiClient.connect();
 }