I have a function that checks if developer mode is enabled or not, as the suggestion here:
Android - How to check if Developer option is enabled
Here is the code:
public boolean isDevMode() {
if(Build.VERSION.SDK_INT >= 17) {
return android.provider.Settings.Global.getInt(getApplicationContext().getContentResolver(),
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0) != 0;
} else {
return false;
}
}
It works perfectly on API 26+ but I've just tested it on the emulator on API 24 and it returns false regardless of if developer settings are enabled or not.
What am I missing? Is it a different option for < 26?