I am retrieveing an XML feed from a url and then parsing it. What I need to do is also store that internally to the phone so that when there is no internet connection it can
build.gradle
file add under dependencies
: implementation 'commons-io:commons-io:2.5'
import org.apache.commons.io.FileUtils;
// given you have a stream, e.g.
InputStream inputStream = getContext().getContentResolver().openInputStream(uri);
// you can now write it to a file with
FileUtils.copyToFile(inputStream, new File("myfile.txt"));