Is it possible to know my location came from gps or glonass?

后端 未结 3 1791
旧巷少年郎
旧巷少年郎 2021-01-06 07:15

Suppose the device support both gps and glonass(support at the hardware level).

Now when I get location by the android.location API, is it possible to know the hardw

3条回答
  •  醉话见心
    2021-01-06 07:51

    The hardware the location came from is the GPS/GLONASS chip in your phone. The chip receives signals from satellites orbiting the earth.

    GPS and GLONASS satellites are used in combination on devices that support this. To determine if GLONASS satellites were used to determine the location, you can either register a GpsStatusListener or call LocationManager.getGpsStatus(). Call getSatellites() on the GpsStatus object and call getPrn() on each GpsSatellite object in the returned list. If the value is between 65 and 88 and the usedInFix() method returns true the last position was calculated using a GLONASS satellite.

    See http://developer.sonymobile.com/knowledge-base/technologies/glonass/

提交回复
热议问题