[英]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.