1

I want to use above mentioned classes and want to retrieve information from their static Constants. I want to retrieve information like this. For example from Settings.Secure

SETTINGS_SECURE
ADB_ENABLED=1
ALLOWED_GEOLOCATION_ORIGINS=http://www.google.co.uk 
ALLOW_MOCK_LOCATION=0
ANDROID_ID=200142d4dfd4e641

But I am actually getting this Output:

SETTINGS_SECURE
ADB_ENABLED=adb_enabled
ALLOWED_GEOLOCATION_ORIGINS=allowed_geolocation_origins
ALLOW_MOCK_LOCATION=allow_mock_location
ANDROID_ID=android_id

Any Suggestions?

1 Answer 1

1

It looks like you're just retrieving the constants' values. As a quick example that will illustrate the difference, to produce the above output:

StringBuilder sb = new StringBuilder("SETTINGS_SECURE\n");

sb.append(Settings.Secure.ADB_ENABLED.toUpperCase())
    .append("=")
    .append(Settings.Secure.getString(getContentResolver(),
        Settings.Secure.ADB_ENABLED))
    .append("\n")

    .append(Settings.Secure.ALLOWED_GEOLOCATION_ORIGINS.toUpperCase())
    .append("=")
    .append(Settings.Secure.getString(getContentResolver(),
        Settings.Secure.ALLOWED_GEOLOCATION_ORIGINS))
    .append("\n")

    .append(Settings.Secure.ALLOW_MOCK_LOCATION.toUpperCase())
    .append("=")
    .append(Settings.Secure.getString(getContentResolver(),
        Settings.Secure.ALLOW_MOCK_LOCATION))
    .append("\n")

    .append(Settings.Secure.ANDROID_ID.toUpperCase())
    .append("=")
    .append(Settings.Secure.getString(getContentResolver(),
        Settings.Secure.ANDROID_ID));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.