2

I have a requirement where i need to block the user from having access to the device (phone) SDCard more like disable the SDCard completely. Is there a way i can achieve this? Can someone kindly guide me with some inputs on this.

Avadhani Y
  • 7,566
  • 19
  • 63
  • 90
S.A.Norton Stanley
  • 1,833
  • 3
  • 23
  • 37

3 Answers3

0

You can safely remove the sdcard, I think your requirement is same:

Intent i = new Intent(android.provider.Settings.ACTION_MEMORY_CARD_SETTINGS);
    startActivity(i);

Unmounting the SD card is one of those actions which could be used maliciously if it wasn't under full user control. If it could be done purely in software (without user intervention) then code could disrupt other apps running on the device.

Sam-In-TechValens
  • 2,501
  • 4
  • 34
  • 67
0

You can't unmount SD Card from running device according to you the best answer on this: (re)mounting the SD card on android emulator

Community
  • 1
  • 1
Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
0

For what purpose you need to disable? To protect your application?If so, you can monitor by

using File observer. Do some stuffs like,If your application moves to particular path use

file.delete(); 
Avadhani Y
  • 7,566
  • 19
  • 63
  • 90
Shadow
  • 6,864
  • 6
  • 44
  • 93
  • 1
    The requirement is such that the user should not be able to use his camera, mobile data and write any information on the SDCard when he is in a certain location. – S.A.Norton Stanley Dec 27 '12 at 05:33