1

I've been searching the internet and can't seem to find any examples showing how to create a file inside an existing folder on the internal storage.

For example, i've got a folder called "unzipped" and a filed called "unzipme.txt". I want to unzip/write the file into this folder /data/data/au.com.BLA.MYAPP/files/unzipped/

Douglas Johgn
  • 221
  • 3
  • 10

1 Answers1

0

To create a folder you could use the following code

File folder = new File(context.getCacheDir().getPath() + "/files/unzipped");
folder.mkdirs();

File unzipMe = new File(folder, "unzipme.txt");
if (!unzipMe.exists()){
    unzipMe.create();
}
Stepango
  • 4,721
  • 3
  • 31
  • 44