// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int NOT_AVAILABLE = -100000;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_DISABLED                = 0;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_OUTOFSERVICE            = 1;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_TEMPORARYUNAVAILABLE    = 2;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_SEARCHING               = 3;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_STABILIZING             = 4;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_OK                      = 5;


import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TableLayout;
import android.widget.TextView;
import java.util.Locale;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.NOT_AVAILABLE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_DISABLED;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_OUTOFSERVICE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_TEMPORARYUNAVAILABLE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_SEARCHING;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_STABILIZING;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_OK;
        location = gpsApp.getCurrentLocationExtended();
        AltitudeManualCorrection = gpsApp.getPrefAltitudeCorrection();
        prefDirections = gpsApp.getPrefShowDirections();
        GPSStatus = gpsApp.getGPSStatus();
        EGMAltitudeCorrection = gpsApp.getPrefEGM96AltitudeCorrection();
        isBackgroundActivityRestricted = gpsApp.isBackgroundActivityRestricted();
        if (isAdded()) {
            if ((location != null) && (GPSStatus == GPS_OK)) {

                phdLatitude = phdformatter.format(location.getLatitude(), PhysicalDataFormatter.FORMAT_LATITUDE);
                phdLongitude = phdformatter.format(location.getLongitude(), PhysicalDataFormatter.FORMAT_LONGITUDE);
                phdAltitude = phdformatter.format(location.getAltitudeCorrected(AltitudeManualCorrection, EGMAltitudeCorrection), PhysicalDataFormatter.FORMAT_ALTITUDE);
                phdSpeed = phdformatter.format(location.getSpeed(), PhysicalDataFormatter.FORMAT_SPEED);
                phdBearing = phdformatter.format(location.getBearing(), PhysicalDataFormatter.FORMAT_BEARING);
                phdAccuracy = phdformatter.format(location.getAccuracy(), PhysicalDataFormatter.FORMAT_ACCURACY);
                phdTime = phdformatter.format(location.getTime(), PhysicalDataFormatter.FORMAT_TIME);

                tvLatitude.setText(phdLatitude.value);
                tvLongitude.setText(phdLongitude.value);
                tvLatitudeUM.setText(phdLatitude.um);
                tvLongitudeUM.setText(phdLongitude.um);
                tvAltitude.setText(phdAltitude.value);
                tvAltitudeUM.setText(phdAltitude.um);
                tvSpeed.setText(phdSpeed.value);
                tvSpeedUM.setText(phdSpeed.um);
                tvBearing.setText(phdBearing.value);
                tvAccuracy.setText(phdAccuracy.value);
                tvAccuracyUM.setText(phdAccuracy.um);
                tvTime.setText(phdTime.value);
                tvTimeLabel.setText(phdTime.um.isEmpty() ? getString(R.string.time) : String.format(Locale.getDefault(), "%s (%s)", getString(R.string.time), phdTime.um));
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int NOT_AVAILABLE = -100000;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_DISABLED                = 0;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_OUTOFSERVICE            = 1;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_TEMPORARYUNAVAILABLE    = 2;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_SEARCHING               = 3;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_STABILIZING             = 4;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int GPS_OK                      = 5;


// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/FragmentGPSFix.java
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TableLayout;
import android.widget.TextView;
import java.util.Locale;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.NOT_AVAILABLE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_DISABLED;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_OUTOFSERVICE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_TEMPORARYUNAVAILABLE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_SEARCHING;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_STABILIZING;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.GPS_OK;

        location = gpsApp.getCurrentLocationExtended();
        AltitudeManualCorrection = gpsApp.getPrefAltitudeCorrection();
        prefDirections = gpsApp.getPrefShowDirections();
        GPSStatus = gpsApp.getGPSStatus();
        EGMAltitudeCorrection = gpsApp.getPrefEGM96AltitudeCorrection();
        isBackgroundActivityRestricted = gpsApp.isBackgroundActivityRestricted();
        if (isAdded()) {
            if ((location != null) && (GPSStatus == GPS_OK)) {

                phdLatitude = phdformatter.format(location.getLatitude(), PhysicalDataFormatter.FORMAT_LATITUDE);
                phdLongitude = phdformatter.format(location.getLongitude(), PhysicalDataFormatter.FORMAT_LONGITUDE);
                phdAltitude = phdformatter.format(location.getAltitudeCorrected(AltitudeManualCorrection, EGMAltitudeCorrection), PhysicalDataFormatter.FORMAT_ALTITUDE);
                phdSpeed = phdformatter.format(location.getSpeed(), PhysicalDataFormatter.FORMAT_SPEED);
                phdBearing = phdformatter.format(location.getBearing(), PhysicalDataFormatter.FORMAT_BEARING);
                phdAccuracy = phdformatter.format(location.getAccuracy(), PhysicalDataFormatter.FORMAT_ACCURACY);
                phdTime = phdformatter.format(location.getTime(), PhysicalDataFormatter.FORMAT_TIME);

                tvLatitude.setText(phdLatitude.value);
                tvLongitude.setText(phdLongitude.value);
                tvLatitudeUM.setText(phdLatitude.um);
                tvLongitudeUM.setText(phdLongitude.um);
                tvAltitude.setText(phdAltitude.value);
                tvAltitudeUM.setText(phdAltitude.um);
                tvSpeed.setText(phdSpeed.value);
                tvSpeedUM.setText(phdSpeed.um);
                tvBearing.setText(phdBearing.value);
                tvAccuracy.setText(phdAccuracy.value);
                tvAccuracyUM.setText(phdAccuracy.um);
                tvTime.setText(phdTime.value);
                tvTimeLabel.setText(phdTime.um.isEmpty() ? getString(R.string.time) : String.format(Locale.getDefault(), "%s (%s)", getString(R.string.time), phdTime.um));
                tvSatellites.setText(location.getNumberOfSatellitesUsedInFix() != NOT_AVAILABLE ? location.getNumberOfSatellitesUsedInFix() + "/" + location.getNumberOfSatellites() : "");