简体   繁体   English

在没有谷歌播放服务的情况下获取用户位置在 android 设备上不起作用

[英]get user location not working on android devices without google play services

I have an issue with huawei devices and all devices without google play services What should I do if I want to get user location from these devices?我遇到了华为设备和所有没有谷歌播放服务的设备的问题如果我想从这些设备获取用户位置,我该怎么办?

You can use LocationManager with GPS or.NETWORK provider.您可以将 LocationManager 与 GPS 或 .NETWORK 提供商一起使用。

LocationManager locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);

Location location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

Reference: get location without google play services -android参考: 在没有谷歌播放服务的情况下获取位置-android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取位置没有谷歌播放服务-android - get location without google play services -android Google Play位置服务无法在某些设备上使用 - Google play location services not working in some devices Flurry for Android设备没有Google Play服务 - Flurry for Android devices without Google Play Services 迁移Android O的Google Play服务位置-支持许多设备 - Migrating Google Play Services Location for Android O - supporting many devices 要求用户在没有 GoogleAPI 或 Google Play 服务的情况下在 android 中启用 GPS 定位 - Ask user to enable GPS location in android without GoogleAPI or Google Play Services 如何在没有Google Play服务的情况下从Android Automotive系统获取位置信息 - How I can get Location from Android Automotive system without Google Play Services 带有Google Play服务的Android Studio“仅设备”位置不起作用 - Android Studio 'Device Only' Location w/ Google Play Services not working Google Play服务或Android定位服务 - Google Play Services or Android Location Services Android:Google为没有Google Play服务的用户签名? - Android: Google signin for a user without Google Play Services? 使用Google Play服务在Xamarin中获取用户位置 - Getting user location in Xamarin with google play services
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM