How to detect and / or enable developer mode in Android using sdk?

How to detect and / or enable developer mode in Android using sdk?

I already know about this:

boolean isDebuggable =  ( 0 != ( getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE ) );

But that is not what I am looking for. I want to see if the developer mode ("USB Debugging") is turned on and, if possible, turn it on.

+4
source share

Source: https://habr.com/ru/post/1535554/


All Articles