So I have an app which is a music player.
Many times a user plays a song and wants to delete it. Many times he finds that there duplicates of files and hence wants to delete it. Many users have more than thousands of songs and it would not be an appropriate solution if the user has to to pin point the location of the file he wants to delete.
I came across this How to use the new SD card access API presented for Android 5.0 (Lollipop)?
and it tells how to create the files given the whole uri.
But The appropriate solution would be if he could just choose the root directory(SD CARD ) instead of the whole path and grant the required permission and the app could manage the rest. This is exactly I want to achieve.
Given that i have only the file path of the file to be deleted and the uri of the root directory from the sd card access framework, what is the best way of deleting the file? is that even possible ? or each time a user has to delete a file, he will have to pin point the location of that file as well?