问题描述
在我的应用我怎么能知道有多少颗卫星是如何使用的/没有。卫星用于GPS定位。
In my application how can i know how many satellites are used/no. of satellite used for gps fix.
我试试下面code,但它每次都返回零。
I try below code but it's return zero every time.
public void onGpsStatusChanged(int event)
{
//Log.e("Gps_Status", "From on gps status changed");
if (event == GpsStatus.GPS_EVENT_SATELLITE_STATUS)
{
GpsStatus status = m_locationManager._myLocationManager.getGpsStatus(null);
Iterable<GpsSatellite> sats = status.getSatellites();
// Check number of satellites in list to determine fix state
if (sats.iterator().hasNext())
{
GpsSatellite gpsSatellite=(GpsSatellite)sats.iterator().next();
if(gpsSatellite.usedInFix())
{
NO_OF_SATELLITE++;
}
Toast.makeText(this, String.valueOf(NO_OF_SATELLITE), Toast.LENGTH_LONG);
}
//Log.e("Used In FIx", String.valueOf(NO_OF_SATELLITE));
}
Log.v("Used In FIx", String.valueOf(NO_OF_SATELLITE));
// Toast.makeText(this, String.valueOf(NO_OF_SATELLITE), Toast.LENGTH_LONG);
}
任何帮助是非常AP preciated。
Any help on this is highly appreciated .
谢谢
Jalp。
ThanksJalp.
推荐答案
哎终于让我找到我的解决方案没有得到。在GPS卫星使用
Hey finally I found my solution for get no. of satellite used in gps.
有关,你必须使用它在android.location包提供MNEA监听器与卫星通信和类似$ GPGSA他们的NMEA标准句返回的响应。
For that you have to use MNEA listener which is provided in android.location package which communicate with satellite and return response in their NMEA standard sentence like $GPGSA.
得到响应后,您必须解析这句话,最后你的工作就完成了。
After getting the response you have to parse the sentence and finally your job is done .
感谢所有对你的评论。
Jalp。
这篇关于有多少卫星在我每一次GPS定位使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!