I recently started my first app (for a psychology study) and I want to create .txt files which will record the participants' answers. (but for now it's just a test file with only one line "this is a test file")
My first problem is that I can't find the file that is supposed to be created. I get no error so I suppose it is created somewhere.
I have read that the files might be in "data/data" folder, which apparently I can't access without rooting my phone (I would like to avoid that).
So my question is, how can I modify the path so the file is created in the Downloads folder or anywhere that I can access? I tried using this.getExternalFilesDir(null)
, Environment.getExternalStorageDirectory()
, Context.getFilesDir()
but I can't find my file on the local storage or on the SD card.
I did add the WRITE_EXTERNAL_STORAGE
permission in the manifest but I don't know if I need to do something else. For instance, I don't know if I have to create a folder for my app (like those com.domain.app folders) of if it's supposed to do it automatically.
Thanks! I know similar questions have been posted but so far I couldn't find an answer that works for me. If I didn't mention something important, don't hesitate to point it out because my guess is I forgot something really basic.