0

I want to start by saying that I am very new to java so I am having issues finding resources. I am trying to find a library that will allow for me to access files in a Moto G4 phone. I have found plenty of examples of how to do this but they never say what library they are using. The code I am interested in is the following: (Note that this is an example and not what I will be doing with these files. I just want to get this script to run)

String path = Environment.getExternalStorageDirectory().toString()+"/Pictures";
Log.d("Files", "Path: " + path);
File directory = new File(path);
File[] files = directory.listFiles();
Log.d("Files", "Size: "+ files.length);
for (int i = 0; i < files.length; i++)
{
Log.d("Files", "FileName:" + files[i].getName());
}

This was pulled from another post on how to find files on an Android phone. Any help would be greatly appreciated. It is important to note that this is just so that I can gain access to these files so that I can move them to my hard drive.

0 Answers0