人造卫星的自然地理化数量

问题描述 投票:1回答:1

任何人都知道如何获得本机反应中的卫星数量。目前,我正在使用https://github.com/react-native-community/react-native-geolocation但是它并没有提供许多卫星

android react-native mobile geolocation location
1个回答
0
投票

对于Android,您可以通过本机模块获取inf。在android native中,您可以使用localManager获取卫星数。

privateLocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 

//it uses GPS, so you have to check if GPS is working

//add the listener
manager.registerGnssStatusCallback(gpsStatusListener);

private GpsStatus.Callback gpsStatusListener = new GpsStatus.Callback() {
    @Override
    public void onSatelliteStatusChanged(GnssStatus status) {
        int count = status.getSatelliteCount()
    }
};

有关如何编写react-native本机模块的信息,请参见官方文档;对于ios,无法获取该信息。

您也可以使用此react-native-location-satellites获取。

© www.soinside.com 2019 - 2024. All rights reserved.