Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to detect the USB-debugging on android devices?

in my app i need a way to detect if the android-device runs in usb-debugging mode.

Is it possible? If yes, how?

thanx in advance

like image 346
Android Developer Avatar asked Oct 01 '12 14:10

Android Developer


Video Answer


1 Answers

You can use the following to get whether or not the ADB is enabled.

int adb = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADB_ENABLED, 0);

If it is enabled, adb == 1, otherwise adb == 0.

like image 67
Raghav Sood Avatar answered Sep 28 '22 06:09

Raghav Sood