[英]get user location not working on android devices without google play services
我遇到了华为设备和所有没有谷歌播放服务的设备的问题如果我想从这些设备获取用户位置,我该怎么办?
您可以将 LocationManager 与 GPS 或 .NETWORK 提供商一起使用。
LocationManager locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.