简体   繁体   中英

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 locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);

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

Reference: get location without google play services -android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM