fusedlocationproviderapi

Clear fused location provider's location for testing

此生再无相见时 提交于 2019-12-20 03:29:05
问题 I would like to know if it is possible to clear the "location" that is stored by play service's fused location API. When testing my app on a real device, I would like to recreate few scenarios and that's the reason I would like to know if this is possible. I tried to clear "Google Play Services" cache and data. But, it does not seem to help me. Location still seems to be cached somewhere. 回答1: Google Play Services is central service and serves every app installed on your device. After

FusedLocationProvider Sample Code Leaks Activity

南笙酒味 提交于 2019-12-13 03:49:52
问题 I'm working on FusedLocationProvider Api to get continuous location updates using sample code in this link. When i rotate device if location updates are not on it runs fine but if location updates are open on each rotation Activity leaks with 1 mLocationCallback object and 2 mListener objects. Setting mLocationCallback null onPause() prevents it from leaking but i need to instantiate new mLocationCallback onResume() and mListener, these are probably mFusedLocationClient, and mSettingsClient

google play services location api sometimes give wrong location

柔情痞子 提交于 2019-12-12 03:25:35
问题 My app use Google Play service API to get the user location and check if the device is inside or outside a particular area of 50 mt of radius. The app use PRIORITY_HIGH_ACCURACY and a Interval of 1 minute. So I create GoogleApiClient: mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API) .build(); mGoogleApiClient.connect(); In the onConnected callback: mLocationRequest = new LocationRequest();

App Crashes While Requesting Location Updates With The Help Of Fused Location

一世执手 提交于 2019-12-11 14:51:51
问题 I was requesting the location updates with the help of LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, locationListener); But As I tried to mention this on a swtich onClickListener , it crashed. However there was no error thrown Android Studio itself. I already have added permission to request Fused Location, coarse Location and Internet as part of this function. I even tried to connect the google Api client before requesting the Updated Like., if

FusedLocationProviderClient.requestLocationUpdates not getting altitudes

和自甴很熟 提交于 2019-12-11 06:35:11
问题 I'm experiencing some strange behavior with our Android app using Fused location Provider Api. In some devices this api is not returning the altitudes I can check it on Moto G 2d generation but our users report the same behavior at least on Moto G 3d generation, Nexus 6 and Moto X Play. In the great majority of other devices altitudes are returning well so I'm pretty sure that my implementation of the Api is correct. The funny part is that I realized that if I use android.location

Is Fused Location Provider good choice?

与世无争的帅哥 提交于 2019-12-10 04:33:46
问题 I am developing an application where I want to use Fused Location Provider. But I have some doubts, and couple of questions. When GPS is off and I set priority to HIGH, does that mean that the GPS will be automatically turned on, or not? Can I set UpdateLocation with Fused provider with HIGH priority on demand to save battery at least a little bit? How can I know what Fused provider is using (is it a GPS or a network provider)? And finally Is Fused provider really the best choice for android

How to get FusedLocation from IntentService

孤者浪人 提交于 2019-12-08 17:24:50
问题 How to retrieve current location by using the new FusedLocation API from an IntentService ? How can i make sure that IntentService will receive all callbacks from FusedLocation API ? ie, How can i obtain the location object synchronously? 回答1: This may help you import java.util.ArrayList; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import

FusedLocationAPI can not remove location updates through AlarmManager

大兔子大兔子 提交于 2019-12-08 05:57:37
问题 I have created simple class to get updated location using google's FusedLocationProviderClient . i.e.: public class LocationProvider extends LocationCallback {... private static FusedLocationProviderClient mFusedLocationClient; private LocationRequest mLocationRequest; if(mFusedLocationClient == null) { mFusedLocationClient = LocationServices.getFusedLocationProviderClient(mContext); mFusedLocationClient.requestLocationUpdates(mLocationRequest, locationCallback, null /* Looper */); }..} Now,

FusedLocationApi with PendingIntent is fired only once and its null

爱⌒轻易说出口 提交于 2019-12-08 00:20:44
Am working on an app that needs location update frequently even when its in the background. Following the documentation here , am working with pending intent not locationlistener. My code is below /** * Created by philip on 7/30/16. */ public class LocationService extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{ private GoogleApiClient mGoogleApiClient; private LocationRequest mLocationRequest; public static final long UPDATE_INTERVAL_IN_MILLISECONDS = 1000 * 30; //1 minute; /** * The fastest rate for active location updates. Exact.

FusedLocationApi Background Location service stops receiving updates randomly

﹥>﹥吖頭↗ 提交于 2019-12-07 10:25:00
问题 i'm trying to use FusedLocationApi with pending intent to get period location updates so i can send the data to some server for processing. Everything works. However, there are some instances where the broadcast just stops receiving. I would need to restart the service again in order for it to continue. I already have the service onStartCommand to return START_STICKY so even if the app is killed it should start the service again. Furthermore, I also added a Boot Completed Intent Receiver so