Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to get accuracy information on Android? #28

Open
micoFinlandes opened this issue Nov 25, 2021 · 0 comments
Open

Is it possible to get accuracy information on Android? #28

micoFinlandes opened this issue Nov 25, 2021 · 0 comments

Comments

@micoFinlandes
Copy link

Nowadays accuracy in Android is pseudo constant 1. At least this (https://stackoverflow.com/questions/28175420/android-compass-accuracy-when-to-calibrate) StackOverflow question and answer gives more options for the value. They come from SensorManager class. Some examplery code of the approach decribed there:

 switch(sensor.getType()) {
        case Sensor.TYPE_MAGNETIC_FIELD :
            switch(accuracy) {
                case SensorManager.SENSOR_STATUS_ACCURACY_LOW :
                    doSomething();
                    break;
                case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM :
                    doSomethingElse();
                    break;
                case SensorManager.SENSOR_STATUS_ACCURACY_HIGH :
                    doNothing();
                    break;
            }
            break;
        default:
            break;
     }

Those functions should be returning a value between 0 and 1. For Low there would be value 0, for Medium 0.5 and High 1 for example. Would that work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant