0

How can i know if an app is creating a folder on the sdcard?i want to allow the user to delete the data left over by the app after it is uninstalled .

Apoorv
  • 13,470
  • 4
  • 27
  • 33

2 Answers2

2

You can check whether the directory exist by using the below code

File f = new File(Environment.getExternalStorageDirectory() + "/somedir");
if(f.isDirectory()) {

You can also use f.exist()

If you really want to check the folder deleted or not, use file explorer from the app store to explore the content of sdcard.

Nikhil Dinesh
  • 3,359
  • 2
  • 38
  • 41
2

Well if you are storing any kind of data in a database,file etc then a folder is created. Otherwise it is not.

By default, uninstalling an android app will delete it's data (Android 2.2+ and if files created manually by you are stored using getExternalDir()) so you don't need to worry about that. The system will take care of it for you.

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84