How can I check the current status of the GPS receiver?

前端 未结 17 1771
时光取名叫无心
时光取名叫无心 2020-11-22 08:53

How can I check the current status of the GPS receiver? I already checked the LocationListener onStatusChanged method but somehow it seems that is not working,

17条回答
  •  野性不改
    2020-11-22 09:46

    With LocationManager you can getLastKnownLocation() after you getBestProvider(). This gives you a Location object, which has the methods getAccuracy() in meters and getTime() in UTC milliseconds

    Does this give you enough info?

    Or perhaps you could iterate over the LocationProviders and find out if each one meetsCriteria( ACCURACY_COARSE )

提交回复
热议问题