How to delete entire contents of sdcard programmatically in Android 2.2
I wish to delete the users entire SDcard programmatically in Android 2.2. What is the easiest way to do this? Will it require root rights? Can I just do an "rm -rf /mnt/sdcard" or do I have to make a recursive loop? Peter Knego You can delete directories with Java. You have to do it recursively if they are not empty: http://www.exampledepot.com/egs/java.io/DeleteDir.html No. All applications have full RW access to external storage. Yes you can execute shell commands (but you'll have to check if "rm" is available): Any way to run shell commands on android programmatically? Checking for