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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 available commands: How can I get information from the shell about commands available in Android shell?