Android: 如何在不注册 google 帐户的情况下获取网络坐标

Android: how to get network coordinates witout signining up in google account

我有一些 android 远离我的设备。我有自己的应用程序和根远程访问权限。该应用程序可以通过互联网为我提供设备的 GPS 坐标。但它仅在设备在 google 帐户中注册时才有效。远程设备不是。 那么我如何才能远程注册(使用 android root shell 或某些应用程序)或在不注册的情况下获取 GPS 坐标?

定位服务不仅使用GPS,还使用周围的WiFi网络和网络定位是Google提供的服务,与GPS全球技术无关。

network/wifi 本地化服务需要 Google 帐户才能工作。

我不确定您或其他用户从哪里获取您的数据,但不需要 Google 帐户来获取位置信息。

有一个简单的步骤来完成它 https://developer.android.com/training/location/receive-location-updates.html 而且没有任何关于 Google 帐户的地方。

如果您想使用 FusedLocationProvider(根据 link),设备必须安装 Google Play 服务。这是一个由 Google 自动安装在所有具有 Google Play 商店的设备上的应用程序。

如果您的设备没有安装 Google Play 商店,那么您必须通过调用以下代码使用 LocationManager https://developer.android.com/reference/android/location/LocationManager.html

LocationManager lm =
     (LocationManager) context.getSystemServices(Context.LOCATION_SERVICE);

并对 lm 实例进行相关调用以接收位置更新。

这两种方法都需要您 AndroidManifest.xml 的位置权限,但 none 需要用户拥有 Google 帐户。