[英]LocationManager Provider Types?
I was trying out the LocationManager<\/code><\/a> .
我正在尝试
LocationManager<\/code><\/a> 。
It lists only 3 providers
GPS|NETWORK|PASSIVE_PROVIDER<\/code> in documentation.
它在文档中仅列出了 3 个提供商
GPS|NETWORK|PASSIVE_PROVIDER<\/code> 。
I used
criteria<\/code> to get best possible location update.
我使用
criteria<\/code>来获得最佳的位置更新。
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
locationManager.requestLocationUpdates(0, 0, criteria, locationListener, null);
I haven't seen this specific issue, but as of Android 11 on some devices it appears getBestProvider<\/code> can return
fused<\/code> and
getProviders()<\/code> can as well.
我还没有看到这个特定的问题,但从 Android 11 开始,在某些设备上似乎
getBestProvider<\/code>可以返回
fused<\/code>并且
getProviders()<\/code>也可以。
Notable,
PROVIDER_FUSED<\/code> was added as a constant in Api 31 https:\/\/developer.android.com\/reference\/android\/location\/LocationManager#FUSED_PROVIDER<\/a>
值得注意的是,
PROVIDER_FUSED<\/code>作为常量添加到 Api 31
https:\/\/developer.android.com\/reference\/android\/location\/LocationManager#FUSED_PROVIDER<\/a>
MotoX Android 5.1
01-28 10:23:11.575 23263-23263 D: Providers: passive gps network
01-28 10:23:11.575 23263-23263 D: Best Provider: gps
Galaxy S9 Android 9
2022-01-28 12:27:24.781 -0500 14129 14129 D: Providers: passive gps network
2022-01-28 12:27:24.781 -0500 14129 14129 D: Best Provider: gps
Galaxy A20 Androi 10
2022-01-28 12:34:53.038 -0500 23114 23114 D: Providers: passive network gps
2022-01-28 12:34:53.040 -0500 23114 23114 D: Best Provider: gps
Motorola Razr Android 11
2022-01-28 23:08:07.003 +0530 29548 29548 D: Providers: passive network gps
2022-01-28 23:08:07.004 +0530 29548 29548 D: Best Provider: gps
Pixel 3a XL Android 12
2022-01-28 12:31:47.386 -0500 20145 20145 D: Providers: passive network fused gps
2022-01-28 12:31:47.387 -0500 20145 20145 D: Best Provider: fused
Pixel 3 Android 12
2022-01-28 10:39:55.397 10580-10580 D: Providers: passive network fused gps
2022-01-28 10:39:55.397 10580-10580 D: Best Provider: fused
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.