Android play services 6.5: LocationClient brakuje
Po aktualizacji do Google Play Services 6.5.87 moja aplikacja nie została skompilowana z powodu brakującej klasy LocationCLient.
W tej chwili link do dokumentacjiJest uszkodzony (404 Nie znaleziono)
Jak to naprawić? Chcę otrzymywać aktualizacje lokalizacji, pracować z geofences, itp..
45
1 answers
Klasa LocationClient została zastąpiona nową FusedLocationProviderApii GeofencingApi, z których oba wykorzystują wspólną technikę połączenia GoogleApiClient do łączenia się z usługami Google Play. Po połączeniu możesz wywołać metody takie jak requestLocationUpdates():
LocationRequest locationRequest = LocationRequest.create()
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
PendingResult<Status> result = LocationServices.FusedLocationApi
.requestLocationUpdates(
googleApiClient, // your connected GoogleApiClient
locationRequest, // a request to receive a new location
locationListener); // the listener which will receive updated locations
// Callback is asynchronous. Use await() on a background thread or listen for
// the ResultCallback
result.setResultCallback(new ResultCallback<Status>() {
void onResult(Status status) {
if (status.isSuccess()) {
// Successfully registered
} else if (status.hasResolution()) {
// Google provides a way to fix the issue
status.startResolutionForResult(
activity, // your current activity used to receive the result
RESULT_CODE); // the result code you'll look for in your
// onActivityResult method to retry registering
} else {
// No recovery. Weep softly or inform the user.
Log.e(TAG, "Registering failed: " + status.getStatusMessage());
}
}
});
56
Author: ianhanniballake,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-12-09 06:57:09
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-12-09 06:57:09