Android 中哪个 LocationProvider 需要付费才能使用?

发布于 2024-11-28 00:47:43 字数 473 浏览 2 评论 0 原文

Android中的LocationManager可以选择LocationProviders /标准.html” rel="nofollow">标准。 Criteria 类有一个方法 isCostAllowed 和 setCostAllowed。哪个LocationProvider需要用户花钱?它只是网络位置提供商,因为它会产生网络流量,还是只是因为未来的某些可能性而实施?

The LocationManager in Android can choose LocationProviders on a specific Criteria. The Criteria class has a method isCostAllowed and setCostAllowed. Which of the LocationProvider costs the user money? Is it only the network location provider because it creates network traffic or is this just implemented because of some future possibilities?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无悔心 2024-12-05 00:47:43

一个可能需要花钱的例子是位置提供商访问手机信号塔位置或 WiFi 接入点位置的远程数据库。这些提供商将使用您的一些数据限额。

我不认为有任何位置提供商本质上需要花钱 - 成本在于使用您的数据限额。

One example that can cost money is a location provider that accesses a remote database of cell tower positions, or wifi access point positions. These providers will use some of your data allowance.

I don't believe there are any location providers that intrinsically cost money - the cost is in the use of your data allowance.

香草可樂 2024-12-05 00:47:43

GPS 本身不需要任何费用,因为您的智能手机中有内置接收器。网络位置会花费您金钱,因为涉及到远程数据库的往返查找。本质上,这是与使用网络位置进行修复相关的数据成本。

GPS per se do not cost any money as there is an in-built receiver in your smartphone. Network location will cost you money as there is a round-trip of lookup involved from remote database. Essentially it is the data cost that is associated with getting the fix using network location.

只涨不跌 2024-12-05 00:47:43

我只是运行一个简单的测试来确认 NetworkProvider 是否被视为需要花钱的提供商:

LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE);
criteria.setCostAllowed(false);

String provider = manager.getBestProvider(criteria, false);
Log.d(getClass().getSimpleName(), "Best Provider is: " + provider);

如果我将允许的成本设置为 false 或 true,结果没有区别:

08-06 14:52:25.375: DEBUG/LocationPlaygroundActivity(30782): Best Provider is: network
08-06 14:52:39.860: DEBUG/LocationPlaygroundActivity(30848): Best Provider is: network

最好的提供商始终是网络。目前似乎没有任何提供商会花费用户的钱。也许这只是为了未来位置提供者的可能性而内置的。

I just run a simple test to confirm if the NetworkProvider is considered as a provider that costs money:

LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE);
criteria.setCostAllowed(false);

String provider = manager.getBestProvider(criteria, false);
Log.d(getClass().getSimpleName(), "Best Provider is: " + provider);

There is no difference in the outcome if I set cost allowed to false or true:

08-06 14:52:25.375: DEBUG/LocationPlaygroundActivity(30782): Best Provider is: network
08-06 14:52:39.860: DEBUG/LocationPlaygroundActivity(30848): Best Provider is: network

The best provider is always network. At the moment it seems as if there is no provider that would cost the user money. Maybe this is just built in for future location provider possibilities.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文