我正在将我的 Qt 桌面应用程序移植到 Android。
在桌面版中,当我写入./myfile.txt
时,我会在可执行文件的同一文件夹中得到一个myfile.txt
。
在我将它移植到 Android 之后,该应用程序运行顺利,但我无法在任何地方找到该文件,因为我是 Android 的新手...
那么文件在哪里呢? Android 应用是否有类似 pwd
的概念?
我正在使用 QFile
和 QTextStream
来生成和写入文件。
QFile file;
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream stream(&file);
stream << "something";
谢谢!
最佳答案
它可能在“应用程序存储”中。
/data/data/com.example.yourAppPackageName/
或在 SD 卡应用程序存储中
/sdcard/Android/data/com.example.yourAppPackageName/
关于android - Qt 安卓 : where is my file if I write to "./myfile.txt"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38024392/