woheller69 / gpscockpit

Android GPS dashboard and head-up display
GNU Affero General Public License v3.0
195 stars 11 forks source link

compass don't work #3

Closed paulle closed 2 years ago

paulle commented 2 years ago

The compass don't work. The compass scale is always grey, no blue as in the screenshot on f-droid and showing north in every position. Android 11 Sony Xperia 4

woheller69 commented 2 years ago

Then your GPS position is not good enough and does not provide data on direction (bearing).

if (mGpsLocation.hasBearing()) {
        mB.gpsCont.compass.setLineColor(ContextCompat.getColor(this,R.color.accent));
        mB.gpsCont.compass.setTextColor(ContextCompat.getColor(this,R.color.dynamicFgDim));
        mB.gpsCont.compass.setShowMarker(true);
        bearing = mGpsLocation.getBearing();
      } else {
        mB.gpsCont.compass.setLineColor(ContextCompat.getColor(this,R.color.disabledStateColor));
        mB.gpsCont.compass.setTextColor(ContextCompat.getColor(this,R.color.disabledStateColor));
        mB.gpsCont.compass.setShowMarker(false);
      }

Or you are not moving. Direction is only available in GPS while moving

paulle commented 2 years ago

Thank you very much for the hint. And yes compass is working with a better GPS fix.

Gesendet von ProtonMail mobile

-------- Original-Nachricht -------- Am 10. Dez. 2021, 06:36, woheller69 schrieb:

Then your GPS position is not good enough and does not provide data on direction (bearing).

if (mGpsLocation.hasBearing()) { mB.gpsCont.compass.setLineColor(ContextCompat.getColor(this,R.color.accent)); mB.gpsCont.compass.setTextColor(ContextCompat.getColor(this,R.color.dynamicFgDim)); mB.gpsCont.compass.setShowMarker(true); bearing = mGpsLocation.getBearing(); } else { mB.gpsCont.compass.setLineColor(ContextCompat.getColor(this,R.color.disabledStateColor)); mB.gpsCont.compass.setTextColor(ContextCompat.getColor(this,R.color.disabledStateColor)); mB.gpsCont.compass.setShowMarker(false); }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.