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) {
}
}