Is there any technique in java through which we can get into android device and turn on its USB debugging mode ON.
I hope not. It is obiviously an inherent security risk to enable and should thus only be enabled if you are really sure what you are doing (e.g. if you are a developer testing an app).
This is only available for system apps in respect of security. If your device is rooted you are able to call this:
Settings.Secure.putInt(getActivity().getContentResolver(),Settings.Secure.ADB_ENABLED, 1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With