android-fusedlocation

Android Fused Location Won't Deliver Periodic Updates

三世轮回 提交于 2020-01-24 09:45:30
问题 I want to get a hard location fix every certain minutes & a soft location fix every certain minutes and if user has moved more then certain meters. I been testing the logic with following piece of code walking (tried it with larger parameters as well while driving) but it doesn't really return me periodic location fixes. It would return a location fix right away when request starts then sometime return 1 location fix few minutes later that but then for up-to an hour it won't return a location

FusedLocationApi is not working while scheduling it with JobScheduler

烈酒焚心 提交于 2020-01-06 05:23:30
问题 Calling FusedLocationApi within jobscheduler doesn't work. I have tried in 2 ways but onConnected() are never called in both of them. How can I make it work? Thankyou MainActivity.class public class MainActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnStartJob = (Button

Even PRIORITY_HIGH_ACCURACY gives very low accuracy location updates

不羁岁月 提交于 2020-01-04 05:39:10
问题 I'm using FusedLocationAPI to get high accuracy location updates (with 2 second update interval and 5 second fastest interval) . It works fine most of the times. But, sometimes it gives accuracy like 1200m. I understand that in the beginning it can happen. But, the problem I'm having is, I get fair (~20m accuracy) updates for a while and then suddenly switches to ~1200m accuracy. How can this happen in Fused API? 回答1: Sometimes it happens. Moreover, erroneous location fixes can arrive for 5

Requesting location updates more often than 5 seconds (Android Fused location)

孤街浪徒 提交于 2019-12-24 12:08:24
问题 Im making a real time location listening app and i need to call location updates in every 3 seconds. I use Fused location. My interval is set to 3 seconds, however it looks like the minumum value for this interval is 5 seconds. Code: public class GpsService extends Service implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener { private static int UPDATE_INTERVAL = 1000 * 3; // /< location update interval private static int FASTEST_INTERVAL = 1000 * 3; // /< fastest

Not Able To Upgrade Gps settings to high Accuracy using FusedLocationProvider In some devices

时光怂恿深爱的人放手 提交于 2019-12-24 10:50:17
问题 I am using SettingsApi and FusedLocationProvider to upgrade Gps settings and getting location updates, I want High accuracy location updates for that I am showing Turn on gps dialog using SettingsApi to upgrade GPS settings to High Accuracy but in some devices (like Mi and Gionee) even if the user has clicked OK button in Turn On Gps Dialog I am getting RESULT_CANCELED on onActivityResult while everything is working perfectly fine in other devices like Motorola, Lenovo When User is Clicking

'LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient)' not returning any location if GPS is off

烂漫一生 提交于 2019-12-23 05:32:51
问题 I'm trying to get user's current location and for that I'm following this tutorial. I'm running the following code on a device running Android Lollipop so there's no issue of runtime permission here. Here's my code ( Update 1.0 ): @Override public void onConnected(@Nullable Bundle bundle) { Log.d("onConnected", "called"); mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(1000); mLocationRequest.setFastestInterval(1000); mLocationRequest.setPriority(LocationRequest

Android Service not updating location

十年热恋 提交于 2019-12-23 03:19:09
问题 I need to update fused location every 1 min and on each 5 meter displacement (I know its bad practice but for the sake of testing and showing in Log ) and i start service by button Pressed as soon as button pressed i got location in logcat but only once. As per Service class the onLocationChanged should called every 1 min but it never calls again even my GPS turn on almost every min and then turn off after while but still there is no Location Update in Logcat.I need service class to keep

Change fuse location setting while service is running

醉酒当歌 提交于 2019-12-23 03:01:44
问题 Hi I am integrating location service in my application. And for that I am using Google's fuse location service. My implementation is as follows : public class LocationNotifyService extends Service implements LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { protected void createLocationRequest() { mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(INTERVAL); mLocationRequest.setFastestInterval(FASTEST_INTERVAL);

Change fuse location setting while service is running

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 03:01:12
问题 Hi I am integrating location service in my application. And for that I am using Google's fuse location service. My implementation is as follows : public class LocationNotifyService extends Service implements LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { protected void createLocationRequest() { mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(INTERVAL); mLocationRequest.setFastestInterval(FASTEST_INTERVAL);

Android LocationServices.FusedLocationApi deprecated

浪子不回头ぞ 提交于 2019-12-17 10:14:46
问题 I couldn't figure out why LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,mLocationRequest, this); "FusedLocationApi" is cross out and point at it saying is deprecated. Click here to view Image import android.location.Location; import android.location.LocationListener; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import com.google.android.gms.common