Is the Fuse Location Provider a good choice?

I am developing an application in which I want to use the Fuse Location Provider. But I have some doubts and a couple of questions.

  • When the GPS is turned off and I set the priority to HIGH, does this mean that the GPS will be automatically turned on or not?
  • Can I install UpdateLocation with Fused provider with high priority on demand to save battery even a little?
  • How can I find out what a paid provider is using (is it GPS or a network provider)? And finally
  • Is a Fused provider really the best choice for an Android location? Are there any negative points?

What is your opinion? Thanks in advance.

+5
source share
4 answers

When the GPS is turned off and I set the priority to HIGH, does this mean that the GPS will be automatically turned on or not?

No, it does not turn on automatically. But if you use SettingsApi, a dialog box is displayed to the user and gives information that GPS should be turned on. If the user accepts this, gps will be active automatically. Check SettingsApi

How can I find out what a paid provider is using (is it GPS or network provider)

If you are using the paid api provider with SettingsApi correctly. It will make the necessary necessary settings for the current location request.

Is Fused provider really the best choice for Android location? Are there any negative points?

In my opinion, you must deal with the direct providers (Gps, network) in front of the running provider. But the merged just asks you: "How accurate are the places you want to get?"

+8
source

As here https://developer.android.com/training/location/index.html clearly stated that the Google Play services location APIs are preferable to the Android location APIs (android. Location) as a way to add location information to the application . If you are currently using the Android location APIs, you are strongly encouraged to switch to the Google Play services location API as soon as possible. So I hope you get your answer.

+3
source

I made a test application for Gps, Wifi and Fused Location Provider and tested it for 2 days. This is better because he uses both of them, and most of the time he is the most accurate. In addition, Gps data is very noisy jitter data to resolve this low-pass filter or other filters. One of the most successful filters used to get the most accurate results is the Kalman filter. FusedLocationProvider uses this filter in the same way as the RotationVector, which is a fused sensor that combines hardware and software. The RotationVector uses an accelerometer, gyroscope (if equipped) and a magnetic field sensor to receive and filter location and azimuth data.

Location.getProvider for Gps with a LocationManager returns β€œgps”, Wifi returns β€œnetwork”, and FusedLocationProvider returns β€œfused”.

When GPS is off and I set HIGH priority, does this mean that GPS will be automatically turned on or not

Everything except the "Battery" is turned off, if available. These settings are available on my Android 7.1.1 phone. The setting for the location was different in previous versions of Android on the user side. As a developer, to enable the use of Gps, you must set mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

PRIORITY_HIGH_ACCURACY - Use this parameter to request the most accurate location. With this setting, location services are more likely to use GPS to determine location.

The priority setting also determines the level of battery usage.

Can I install UpdateLocation using the Fused provider with high priority on demand to keep the battery at least a little?

Yes, you can set the location request interval in addition to priority.

 mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS); mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS); 

How can I find out what a paid provider is using (is it GPS or a network provider)?

A location from Wifi never returns true for Location.hasSpeed ​​(), but Gps almost always returns true if you are outside. Also, location.getExtras () have satellite tags that you can check for satellites that are only available for GPS. The speed may be wrong if you go or while reading so far, I have not tried it by car, when the speed is less than 5 km / h, this is not very accurate. I mean, if you use FLP, and the last location data contains speed information determined from Gps .

Are there any negative points?

As with Android 8.0 and above, l restriction on retrieving ocation unless you use the Foreground service or get a foreground location until the application pauses for both FLP and LocationManager.

FLP also requires that GooglePlayService be available on the user device and must be above a certain version. 10 or 11, depending on which one you are using. This can be a problem if you want to publish your applications in a country, such as China, which prohibits Google Play services.

+2
source

Existing answers do not say why it is better to use FusedLocationProvider.

This is better because the API will work from more data sources (sensors, Wi-Fi, context, history) in an intelligent and economical way. In addition, Google always improves it by adding more data sources. If your application uses it, you get these improvements for free.

+1
source

All Articles