2

I have written an app that uses NMEA data, provided by NmeaListener. This app works perfectly on following devices:

  • Asus Nexus 7, Android 4.1.1
  • Samsung Nexus S, Android 4.1.2
  • SonyEricsson Xperia Mini, Android 2.3.4
  • SonyEricsson Xperia X10 Mini, Android 2.1.1

On all those devices, the onNmeaReceived() is called with no problem.

But on the low cost device

  • Huawei/Vodafone 858, Android 2.2.2

onNmeaReceived() is not called at all. At least onLocationChanged() is called on all devices, including the Huawei. But I don't need the location, I need the NMEA data.

So, what can I do?

Thanks in advance for your help!

public class Main extends Activity implements NmeaListener, LocationListener {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    LocationManager location = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    location.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1l, 1l, this);
    location.addNmeaListener(this);
}

@Override
public void onNmeaReceived(long timestamp, String nmea) {
}

@Override
public void onLocationChanged(Location arg0) {
}

@Override
public void onProviderDisabled(String arg0) {
}

@Override
public void onProviderEnabled(String arg0) {
}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
}
user1131536
  • 537
  • 2
  • 6
  • 16
  • As far as I can remember, even in devices receiving NMEA sentences the types of sentences received will vary. What do you need the NMEA string for? – Mister Smith Oct 18 '12 at 10:37

1 Answers1

3

This seems to be a known issue if you look at this thread:

Issue 7321: NmeaListener does not receive nmea sentences

if this is affecting you there is probably no other solution than generating fake NMEA from the location updates, at least on the affected phones.

[Edit]

From your comment it seems that you assume you need NmeaListener in order to display info like signal strengths and Satellites, but I think you can do this without NmeaListener, just look at the answers to:

How to measure GPS signal strength on Android?

Community
  • 1
  • 1
Raimo Ihle
  • 302
  • 1
  • 3
  • This issue cannot be the problem: There are apps running on this device which can show signal strength of any satellite in view/use. Since you cannot extract this info from the location, there must be another solution. ;-) – user1131536 Oct 18 '12 at 11:48
  • Maybe those other apps use [this answer](http://stackoverflow.com/questions/3551697/how-to-measure-gps-signal-strength-on-android) to display signal strength instead of NMEA data? – Raimo Ihle Oct 18 '12 at 11:56
  • Yes... I think that's the way "they" do it.Thank you! – user1131536 Oct 18 '12 at 13:12