For OJ problem solving I often face importance to have my outputs as a file. But freopen() does not work in android. Actually, there is a way that copy the code in a root diretory using Termux (or like apps) and then
./a.out <input.txt> output.txt
But it is very long process. Is there any way to doing this input/output easily any app or method?