How to detect Location Provider ? GPS or Network Provider

前端 未结 2 1141
野的像风
野的像风 2020-12-18 15:32

I\'m using Fused Location Provider for location updates in my app. According to Fused Location Provided documentation, it uses all available resources (e.g. Wifi, GPS, Cell

2条回答
  •  暖寄归人
    2020-12-18 15:59

    You can check the location provider by location.getProvider() from the location you are getting.

    Either you are using fused location api or a previous one, you will get the location from locationManager.getLastKnownLocation or LocationServices.FusedLocationApi.getLastLocation and from location you can get provider by location.getProvider

提交回复
热议问题