android - Qt 安卓 : where is my file if I write to "./myfile.txt"?

标签 android c++ qt path

我正在将我的 Qt 桌面应用程序移植到 Android。 在桌面版中,当我写入./myfile.txt时,我会在可执行文件的同一文件夹中得到一个myfile.txt。 在我将它移植到 Android 之后,该应用程序运行顺利,但我无法在任何地方找到该文件,因为我是 Android 的新手...

那么文件在哪里呢? Android 应用是否有类似 pwd 的概念?

我正在使用 QFileQTextStream 来生成和写入文件。

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/

相关文章:

android - Android 中的树 ListView

android - 使用 Google TV 'pairing' 存储 'Anymote Protocol' 信息

java - onTouch 方法 - 跟踪已单击或按下的按钮实例

c++ - 派生模板类访问基类成员数据

java - 错误:(31, 32)错误:不兼容的类型:FragmentOne无法转换为Context

c++ - 获取模板堆栈实现的 C++ 语法错误

c++ - 试图从 Derived* 的 vector 中分配 Base* 的 vector

c++ - QAbstractitemModel - 无法使用 getItem 和 QModelIndex 获取 QAbstract ModelItem

c++ - posix信号 react 时间

c++ - 使用QPainter在Widgets之间画一条线