3

Is there any technique in java through which we can get into android device and turn on its USB debugging mode ON.

Swapnil Walivkar
  • 295
  • 3
  • 5
  • 15

2 Answers2

2

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).

koljaTM
  • 10,064
  • 2
  • 40
  • 42
  • 1
    But we can turn it ON through device's developer option. So, there must be some thing in java which will help us in doing similar thing through code. – Swapnil Walivkar Aug 21 '13 at 10:46
2

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);
Steve Benett
  • 12,843
  • 7
  • 59
  • 79