To detect if developer options are enabled or not in an android device we could the following code:
if (Settings.Secure.getInt(this.getContentResolver(), Settings.Global.ADB_ENABLED , 0) == 0) {
// show some error.
// we will show error even if 'adb' setting is not available on device, so that we allow our app on fully secure device.
}