I stumbled upon this message recently, and I was pretty sure that this constructor wasn't deprecated in prior versions to 18.0.0, but I cannot find information anywhere that this one has been deprecated either.
And what should we use instead, is there another way to create a locationRequest
?
public final class LocationRequest extends Object. implements Parcelable. An encapsulation of various parameters for requesting location through FusedLocationProviderClient .
setFastestInterval(long) means - if a location is available sooner you can get it (i.e. another app is using the location services).
Yes, the LocationRequest constructor is deprecated. You can use its static method LocationRequest.create () to create a location request. Ahh !! Very good ! From which version was this one introduced ? I think after version 18.0.0 constructor was deprecated.
And what should we use instead, is there another way to create a locationRequest ? Yes, the LocationRequest constructor is deprecated. You can use its static method LocationRequest.create () to create a location request. Ahh !! Very good ! From which version was this one introduced ?
LocationRequest() is obsolete and deprecated I was building my Geolocation Xamarin App and recently found out upon trying to create a "mLocationRequest = new LocationRequest()" that LocationRequest() has been deprecated. Does anyone know how or what code to replace it with? dotnet-xamarin Comment Comment · Show 15 Comment
LocationRequest objects are used to request a quality of service for location updates from the FusedLocationProviderApi. For example, if your application wants high accuracy location it should create a location request with setPriority (int) set to PRIORITY_HIGH_ACCURACY and setInterval (long) to 5 seconds.
Yes, the LocationRequest constructor is deprecated. You can use its static method LocationRequest.create()
to create a location request.
Kotlin:
locationRequest = LocationRequest.create().apply { interval = 100 fastestInterval = 50 priority = LocationRequest.PRIORITY_HIGH_ACCURACY maxWaitTime= 100 }
Java:
locationRequest = LocationRequest.create() .setInterval(100) .setFastestInterval(3000) .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) .setMaxWaitTime(100);
For anyone who faces this error in geolocator 8.0.1
of Flutter. Try to edit FusedLocationClient.java:199
for now. Then wait for author to update the pub package
From
LocationRequest locationRequest = new LocationRequest();
To
LocationRequest locationRequest = LocationRequest.create();
This is the LocationRequest
class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With