my question is on an Android phone, how can I check if the USB debugging flag is enabled or not programmatically? in my application I want to show USB debugging status and get it programmatically
How to get if usb debugging is enabled programmatically?
Try the following:
if(Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADB_ENABLED, 0) == 1) { // debugging enabled } else { //;debugging does not enabled }
Plain:
boolean isDebuggable = ( 0 != ( getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE ));
And if you want to check if it is connected:
if (!Debug.isDebuggerConnected()){ //Yes, it is. }
Source: https://habr.com/ru/post/953557/More articles:CMake does not find Boost library when using android-cmake toolchain binding file - c ++Xpath selects elements except the last wth element contains the syntax - domget selected html in ckeditor - javascriptNoClassDefFoundError: org / apache / tomcat / util / codec / binary / Base64 - javaHow to add additional information to the figure legend? - matlabWhy is more memory allocated to a local variable on the stack than is required in C ++? - c ++Initializing a multiset with a custom comparison function in C ++ - c ++! heap -p -a VS! heap -x - windbgIs there a reason why we cannot have syntactic sugar around tuples? - c #https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/953562/can-i-pass-arguments-to-a-base-constructor-from-a-derived-classs-default-constructor&usg=ALkJrhg4nSOEypQGXAhtZz2aRLMfKEhdXwAll Articles