android,fusedlocationproviderapi
A suggestion to lower battery consumption, you could use Activity Detection to determine how often you need to determine position. In this regard I can recommend https://github.com/mcharmas/Android-ReactiveLocation to which I contributed with the Activity Detection part. The library also greatly reduces the lines of coded needed to get fused locations....
android,gps,location,google-api-client,fusedlocationproviderapi
The issue has been resolved, there was some interaction going on between the GoogleApiClient and a GoogleMap element. The GPS radio being turned on was coming from the map element but was triggered by the creation of the GoogleApiClient.
android,location,google-play-services,android-geofence,fusedlocationproviderapi
The LocationClient class has been replaced with the new FusedLocationProviderApi and the GeofencingApi, both of which use the common GoogleApiClient connection technique to connect to Google Play Services. Once you are connected, you can call methods such as requestLocationUpdates(): LocationRequest locationRequest = LocationRequest.create() .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); PendingResult<Status> result = LocationServices.FusedLocationApi .requestLocationUpdates( googleApiClient,...
android,gps,location-provider,fusedlocationproviderapi
You need to make use of Service import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationManager; import android.os.Bundle; import android.os.IBinder; import android.util.Log; public class MyService extends Service { private static final String TAG = "BOOMBOOMTESTGPS"; private LocationManager mLocationManager = null; private static final int LOCATION_INTERVAL = 1000; private static...
android,permissions,gps,android-location,fusedlocationproviderapi
This is an interesting problem, and I was under the impression that using ACCESS_COARSE_LOCATION would use WiFi, since that's what the documentation says. The documentation for ACCESS_COARSE_LOCATION states: Allows an app to access approximate location derived from network location sources such as cell towers and Wi-Fi. So, I put it...
android,location,alarmmanager,periodic-task,fusedlocationproviderapi
Per the LocationRequest documentation: In between these two extremes is a very common use-case, where applications definitely want to receive updates at a specified interval, and can receive them faster when available, but still want a low power impact. These applications should consider PRIORITY_BALANCED_POWER_ACCURACY combined with a faster setFastestInterval(long) (such...
android,gps,fusedlocationproviderapi
That is not what accuracy figure means. Quoting from google docs: We define accuracy as the radius of 68% confidence. In other words, if you draw a circle centered at this location's latitude and longitude, and with a radius equal to the accuracy, then there is a 68% probability that...
android,geolocation,fusedlocationproviderapi
Unfortunately I don't believe there's much you can do about it. The reason you see those updates with great changes it's because indoors, you won't get a GPS lock, so the device is relying on cell tower and WiFi hotspot triangulation to determine your location, and something around 200m to...
android,fusedlocationproviderapi
No, you have to implement your own way to wait up to 1 minute and terminate waiting for location. You also need to act properly with lifecycle and situation when user will get location update earlier.
android,geolocation,google-play-services,fusedlocationproviderapi
Couple things can help: Use ProGuard to strip out unused code - most folks leave this disabled for development builds, to avoid the extra build time, and enable for release builds. Use the new granular dependency management introduced in Play Services 6.5. You can select which of the Play Services...
android,location,google-play-services,fusedlocationproviderapi
API calls will fail unless GoogleApiClient is in the connected state. You request it to connect in onStart and it's asynchronously connected. You obviously shouldn't put a random delay in onStart and you shouldn't do so in an AsyncTask as that will be flaky. Make your API call in (or...
android,fusedlocationproviderapi
Yup, so you would do it when you're building the settings request by using .setAlwaysShow(true). An example would look like this: LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(mLocationRequest) .setAlwaysShow(true);...
android,location,fusedlocationproviderapi
It may happen that you are getting different lat-long in onLocationChanged method which describes more displacement than 10. So kindly checkout the lat-long which you are getting and measure the distance once manually to cross-verify the things. Apart from above, one more possible reason is matter of priority, If above...
android,fusedlocationproviderapi
I think you can just use the LocationManager per this question: How to check if Location Services are enabled?
android,fusedlocationproviderapi
You have to use LocationListener for LocationServices.FusedLocationApi.requestLocationUpdates's locationListener not android.location.LocationListener but com.google.android.gms.location.LocationListener ...
android,android-location,fusedlocationproviderapi
The Geofencing API must be specifically registered via GeofencingApi.addGeofences(). Assuming you actually want to receive the location information from the requestLocationUpdates() call you are doing, you should use LocationResult.extractResult() in place of GeofencingEvent.fromIntent(). An alternative for older versions of Google Play services is to use the key KEY_LOCATION_CHANGED to extract...
android,gps,location,location-provider,fusedlocationproviderapi
In the end, I just did it like this: I've setInterval(5000) and setFastestInterval(5000) and then, for each read location, if distance between them is bigger than 100m, I send the location to my server. I gave up on using smallestDisplacement. This seem to work reliably....
android,google-api-client,fusedlocationproviderapi
Instead of: implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener try: implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener This resolves all three problems originally posted above. However, now the method onDisconnected() is marked with an error method does not override method from superclass. The error is fixed when you use all four: implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener,...
android,google-api-client,fusedlocationproviderapi
You missed mGoogleApiClient.connect(); ...