In our App, we have created folders and store some images in internal storage through our app. I want to delete these folders and images when user uninstalls the app.
Here is my code, with the way I am storing currently:
public void cropImage(Uri sourceUri, String fileName)
{
File myDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
+ File.separator
+ getString(R.string.app_name) + File.separator + getString(R.string.app_name_images) + File.separator);
if (!myDir.exists()) {
myDir.mkdirs();
}
File outputFile = new File(myDir, fileName);
UCrop.of(sourceUri, Uri.fromFile(outputFile)).start(this);
}