2

How can I programmatically prevent a user from using the USB port of an Android tablet?

I don't think it can be achieved by normal applications. Can it be done with a system application?

Can somebody suggest a good starting point.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Mithun Sreedharan
  • 49,883
  • 70
  • 181
  • 236
  • 1
    Check this SO question, it may helps you a bit: [Programmatically Turn Off USB Storage on Android Devices](http://stackoverflow.com/questions/7396757/programmatically-turn-off-usb-storage-on-android-devices) – Paresh Mayani Nov 17 '11 at 05:56
  • 2
    This thread may be helpful to you: [Stop USB Port programmatically](http://groups.google.com/group/android-developers/browse_thread/thread/131d7638634f8812?pli=1) – Paresh Mayani Nov 17 '11 at 05:59
  • @Paresh Mayani Later one suggest to build a kernel module and moving the driver to/fro for enable/disabling usb storage! Is that you suggesting? Do I need to write my own kernal or simply a kernel module? – Mithun Sreedharan Nov 17 '11 at 06:09

2 Answers2

1

You can't do this programatically through any formal API. If you're willing to hack into the kernel, you probably could, but that's going to be device specific.

Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102
1

There is a way to create a enterprise applications that are installed by device administrators on Android Handsets to enforce enterprise mobile handset policies. Have a look at the Documentation for further information. There is something to disable the camera maybe there is also an option to disable USB.

This is a solution to enforce security related rules on corporate handsets. It should not be used to disable USB because it comes handy for your App.

Janusz
  • 187,060
  • 113
  • 301
  • 369