Jede Hilfe, um die NMEA Satz wie $ GPRMC anzuzeigen ..... ich den Code unten bin mit:NMEA-Satz anzeigen?
public class SampleNMEA extends Activity implements LocationListener, GpsStatus.Listener,GpsStatus.NmeaListener{
LocationManager lm;
TextView output;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
output = (TextView)findViewById(R.id.out);
lm = (LocationManager) getSystemService(LOCATION_SERVICE);
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000,10,this);
final Location location=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
output.append("\nBelow Data is about the your location:");
output.append("\n\n\nLatit:"+location.getLatitude());
output.append("\n\nLongitude:"+location.getLongitude());
output.append("\n\nTime: "+location.getTime());
}
public void onLocationChanged(Location location)
{
output.append("\n\n\nLatitude:"+location.getLatitude());
output.append("\n\nLongitude:"+location.getLongitude());
output.append("\n\nTime: "+location.getTime());
}
public void onProviderDisabled(String arg0) {
// TODO Auto-generated method stub
}
public void onProviderEnabled(String arg0) {
// TODO Auto-generated method stub
}
public void onStatusChanged(String arg0, int arg1, Bundle arg2)
{
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000,10,this);
final Location location=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
output.append("\n\n\nLatitude:"+location.getLatitude());
output.append("\n\nLongitude:"+location.getLongitude());
output.append("\n\nTime: "+location.getTime());
}
public void onGpsStatusChanged(int event)
{
}
public void onNmeaReceived(long timestamp, String nmea)
{
output.append("NMEA Sentence: "+nmea);
}
}
Jede Hilfe, die ich hinzugefügt Berechtigungen in manifest.xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
Hey Jagan, hast du dein Problem gelöst? Ich möchte dieselbe Operation durchführen, aber das kann ich nicht. Ich möchte die aktuell verwendeten Satelliteninformationen sowie Längen- und Breitengrade von NMEAListener abrufen. Kannst du mir bitte einen Gefallen tun, kannst du bitte deinen Code teilen, damit ich meinen Fehler finden kann und ich mehr Ahnung davon bekommen kann. Danke im Voraus. – anddev