4

I am assigned a data recovery application task. I have searched a lot but I could not find a single solution to the problem. I just saw the comment of a developer on Stack Overflow but it does not provide me sufficient information. His comment was:

public ArrayList<File> listf(File xfile, ArrayList<File> files) {

    // get all the files from a directory
    File[] fList = xfile.listFiles();
    for (File file : fList) {
        if (file.isFile()) {
            files.add(file);
        } else if (file.isDirectory()) {
            listf(file, files);
        }
    }
    return files;
}

Is there any library or API that recovers the deleted images, videos, and apks. If not how can I do this task?

sandpat
  • 1,478
  • 12
  • 30
Hussain
  • 79
  • 2
  • 14
  • Have you had a look at [this post on android.stackexchange](https://android.stackexchange.com/a/208114/18948)? It seems pretty well-researched. – Simon MᶜKenzie Nov 23 '19 at 08:22
  • Unfortunately I am new to this area. He well explained but I need some code that would help me developing this app. – Hussain Nov 23 '19 at 09:22

1 Answers1

0

I don't think there are any libraries or any API officially provided by the android team over this. The reason you didn't get any references linked to this topic because there is no support for this on android as of now. Also due to computation limitations on mobile, it will be hard to support such utility.

What other file manager applications or data recovery agents do is they store the deleted files on some virtual space called recyclerbin. If you delete anything it does not gets deleted from disk it gets stored in the recycle bin and when recalled it gets recovered. In actual they don't do any data recovery and user's reviews on play stores on such applications are enough to point this out.

See how recovery works.

https://en.wikipedia.org/wiki/Data_recovery

vikas kumar
  • 10,447
  • 2
  • 46
  • 52
  • Thank you Vikas. But I got know about an app called Dumbster it recovers deleted images when it was not installed before the images are deleted. So how it recovers the images? – Hussain Nov 23 '19 at 08:51
  • Hmm, I have seen the Dumpster app but it doesn't work properly the way they advertise it. Users face problems of videos getting into thumbnails and also they said officially "they don't guarantee it will recover files that were deleted before the app installation. And it is designed to work after the installation of app." I am not denying about the possibility, but whatever the solution they have developed it does not work properly. you better add some reputation point on this question to get better visibility to other developers that may help. – vikas kumar Nov 23 '19 at 09:36