【问题标题】:GPS location providers which does not use google play services不使用 google play 服务的 GPS 位置提供商
【发布时间】:2015-02-25 08:32:31
【问题描述】:

我有一个带有 GPS 芯片的安卓设备,我想使用它获取位置,但该设备没有安装 google play 服务(它不支持 google play 服务)。所以我无法使用android标准LocationManager

有人对如何获取位置有建议吗?

【问题讨论】:

  • 我不这么认为 LocationManager 与 google play 服务有任何关系。它在 android 包中
  • @RandykaYudhistira:我测试过了。如果未安装 google play 服务,位置监听器将不起作用!
  • 你是什么意思“不会工作”?给我看看你的logcat
  • 它永远不会进入'onLocationChanged'方法。我在我的手机上测试了这个应用程序,它运行良好。我完全确定。我正在寻找其他 GPS 位置提供商。

标签: android gps location-provider


【解决方案1】:

您可以使用LocationManager,它不需要 Google Play 服务,并且可以让您直接访问 GPS、网络和/或被动位置更新。

您可能正在尝试使用需要 Google Play 服务的较新的Location API。更新的 API 将“LocationManager”替换为“FusedProvider”,根据用户设置和位置自动在被动、网络和 GPS 之间切换。虽然这更容易实现并且可能更省电,但使用旧的 LocationManager 应该完全没问题。

【讨论】:

    猜你喜欢
    • 2011-10-10
    • 1970-01-01
    • 2012-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多