2

NmeaListenerが提供するNMEAデータを使用するアプリを作成しました。このアプリは、次のデバイスで完全に動作します。

  • 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

これらすべてのデバイスで、onNmeaReceived()が問題なく呼び出されます。

しかし、低コストのデバイスでは

  • Huawei / Vodafone 858、Android 2.2.2

onNmeaReceived()はまったく呼び出されません。少なくともonLocationChanged()は、Huaweiを含むすべてのデバイスで呼び出されます。しかし、場所は必要ありません。NMEAデータが必要です。

それで、なにかお手伝いできますか?

よろしくお願いします!

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

1 に答える 1

3

このスレッドを見ると、これは既知の問題のようです。

問題7321:NmeaListenerがnmeaセンテンスを受信しない

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?

于 2012-10-18T11:37:08.180 に答える