Deleting files from sdcard

Put your problem here if it does not fit any of the other categories.

Deleting files from sdcard

Postby Asgard » Tue Dec 25, 2007 8:44 pm

Hi all.
I'm trying to delete file from sdcard (I know that I cannot delete from internal file system).

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. if(!deleteFile(fileName))
  5.  
  6.        showAlert(getString(R.string.alert), getString(R.string.delete_error), getString(R.string.back), true);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


or

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. if(!new File(fileName).delete())
  2.  
  3.         showAlert(getString(R.string.alert), getString(R.string.delete_error), getString(R.string.back), true);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


but nothing of this works.

I'm able to delete files from data/data/my_package_name/files/ dir using

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. if(!deleteFile(fileName))
  5.  
  6.        showAlert(getString(R.string.alert), getString(R.string.delete_error), getString(R.string.back), true);
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


It work's with files created within application, but I cannot delet content from sdcard, which was added using some tools (WinIso).

Does anyone know where the problem is?

Thanks.
Catch the moment
Asgard
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Dec 15, 2007 8:49 pm

Top

Postby Asgard » Wed Dec 26, 2007 4:26 pm

The problem was with sdcard image. Don't use external tools, only "adb"! :)
Catch the moment
Asgard
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Dec 15, 2007 8:49 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests