title: Accessing NMEA on Android API level < 24 when compiled for target API level 29?
body: <p>I just tried updating the target and compile API level of our app to 29 (Android 10) and noticed that I cannot compile any more because <code>LocationManager.addNmeaListener</code> only accepts <code>OnNmeaMessageListener</code> (introduced with API level 24) instead of the older and deprecated <code>GpsStatus.NmeaListener</code> (so, I get "<em>incompatible types: NmeaListener cannot be converted to OnNmeaMessageListener</em>").</p>
  
  <p>I understand that <code>addNmeaListener(NmeaListener)</code> has been deprecated in previous versions and I am prepared to refactor my code to branch for different API levels, but since I could not find any deprecated methods with different names or any compatibility libraries for LocationManager, it seems like there is no way to access NMEA data on Android 6 devices if I target Android 10 (which will be mandatory at some point).</p>
  
  <p>Any suggestions on how I can still get NMEA data on older devices?</p>
  
  <p><em>A little additional background if someone has ideas on how to avoid NMEA data:
  Our app "phyphox" is designed to allow students to use the sensors in their phones for physics experiments. It is important for us to run on old devices (Android 4+), because using smartphone sensors in physics education is especially valuable for schools and students with little funding. At the same time, we want to have comparable experimental results for all devices (new/old, Android/iOS). Therefore, we need the NMEA data to calculate the altitude above the geoid instead of the altitude above the WGS84 ellipsoid (as provided by <code>Location.getAltitude()</code>, so the students get consistent and comparable results. Therefore, any suggestion for alternative ways to achieve that are welcome too.</em></p>
  
  <p>You can have a look at the current code for API 28 here:</p>
  
  <p><a href="https://github.com/Staacks/phyphox-android/blob/master/app/src/main/java/de/rwth_aachen/phyphox/gpsInput.java" rel="noreferrer">https://github.com/Staacks/phyphox-android/blob/master/app/src/main/java/de/rwth_aachen/phyphox/gpsInput.java</a></p>