Код: Выделить всё
private fun check_My_Android_Mobile_Developer_Mode_Status() {
// solution 1
val adb: Int = Settings.Secure.getInt(this.contentResolver,
Settings.Global.ADB_ENABLED, 0)
Toast.makeText(this,"USB Debugging Detect: adb mode:"+adb, Toast.LENGTH_LONG).show()
// solution 2
if(Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) {
// Developer Mode enabled
Toast.makeText(this,"Developer Mode enabled: Show Alert", Toast.LENGTH_LONG).show()
} else {
//Developer Mode does not enabled
Toast.makeText(this,"Developer does not enabled: Running Safe Mode", Toast.LENGTH_LONG).show()
}
}
Ссылки ниже:
how-to-check-usb-debugging-enabled
wireless-adb-android-11
android-detect-when-adb-active-over-usb
Подробнее здесь: https://stackoverflow.com/questions/739 ... droid-prog