This is how you can check if a pesific fil exists on your sdcard, this will all so work for you system directory but not the data derectory as that an only be read with super user permissions(also cant be read by an api).
boolean exists1 = (new File(Environment.getExternalStorageDirectory() + “/example/1″)).exists();
if (exists1) {
}
Alternatively this methord can be used to create a new folder or delete files/directorys
File a = new File(Environment.getExternalStorageDirectory() + “/example1/example2″);
a.mkdir();//this will create example2 only
a.mkdirs();//this will create example1 and example2
a.delete();//this will delete example2 weather it is a file or a folder
September 23, 2011 at 12:29 am
That’s pretty exciting news and I really hope more people get to read this.
September 27, 2011 at 2:34 pm
It was a very nice idea! Just wanna say thank you for the information you have diffused. Just continue composing this kind of post. I will be a loyal reader, thanks a lot.
October 28, 2011 at 11:41 pm
Awesome piece of writing..