Is there any way to access device settings programmatically?
For Example: Settings > Developer Options > USB debugging > True/False
Thanks in advance.
<
If you app is System app then you Simply do this to enable/disable USB Debugging
Settings.Secure.putInt(getActivity().getContentResolver(),Settings.Secure.ADB_ENABLED, 1);
You also need root access to do this. I have rooted device and I just simply execute SU to enable/disable Usb Debugging.
Process proc = Runtime.getRuntime().exec(new String [] { "su", "-c", "setprop", "persist.service.adb.enable", "0"});
proc.waitFor();
Process proc2 = Runtime.getRuntime().exec(new String [] { "su", "-c", "stop", "adbd"});
proc2.waitFor();
Good thing is you don't need to place your application in (/system/priv-app/) Your simple app i.e. (/data/app) can do this.