I am trying to create a file from a byte [] obtained from a web service. I am using this code with volley:
String nameFile = Environment.DIRECTORY_DOWNLOADS + "\" + documento.NombreFichero;
FileOutputStream outputStream;
outputStream = getActivity().openFileOutput(nameFile, Context.MODE_PRIVATE);
outputStream.write(response); // response es el byte[] obtenido
outputStream.close();
Toast.makeText(getActivity(), "Download complete.", Toast.LENGTH_LONG).show();
In theory I download the file, but I can not find where it is created, so I do not know if it does. Is there any way to do it by saving it in the download folder of the device and then read it?
Thanks in advance.