Search in sources :

Example 6 with LocationRequest

use of com.google.android.gms.location.LocationRequest in project Android-ReactiveLocation by mcharmas.

the class MockLocationsActivity method onLocationPermissionGranted.

@Override
protected void onLocationPermissionGranted() {
    mockModeToggleButton.setChecked(true);
    final LocationRequest locationRequest = LocationRequest.create().setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY).setInterval(2000);
    updatedLocationSubscription = locationProvider.getUpdatedLocation(locationRequest).map(new LocationToStringFunc()).map(new Func1<String, String>() {

        int count = 0;

        @Override
        public String call(String s) {
            return s + " " + count++;
        }
    }).subscribe(new DisplayTextOnViewAction(updatedLocationView));
}
Also used : LocationRequest(com.google.android.gms.location.LocationRequest) LocationToStringFunc(pl.charmas.android.reactivelocation.sample.utils.LocationToStringFunc) DisplayTextOnViewAction(pl.charmas.android.reactivelocation.sample.utils.DisplayTextOnViewAction)

Aggregations

LocationRequest (com.google.android.gms.location.LocationRequest)6 LocationSettingsRequest (com.google.android.gms.location.LocationSettingsRequest)2 LocationSettingsResult (com.google.android.gms.location.LocationSettingsResult)2 Address (android.location.Address)1 Location (android.location.Location)1 AsyncTask (android.os.AsyncTask)1 PendingResult (com.google.android.gms.common.api.PendingResult)1 Status (com.google.android.gms.common.api.Status)1 List (java.util.List)1 ReactiveLocationProvider (pl.charmas.android.reactivelocation.ReactiveLocationProvider)1 AddressToStringFunc (pl.charmas.android.reactivelocation.sample.utils.AddressToStringFunc)1 DisplayTextOnViewAction (pl.charmas.android.reactivelocation.sample.utils.DisplayTextOnViewAction)1 LocationToStringFunc (pl.charmas.android.reactivelocation.sample.utils.LocationToStringFunc)1 Func1 (rx.functions.Func1)1