Important: Please read the Qt Code of Conduct -

[SOLVED]Android: Path issue

  • I'm working on porting a desktop application to Android. This snippet doesn't work correctly under Android because of path issue (unable to extract a file from app. resource to app path).

    May you please guide me how to fix path issue under Android?

    [code]void MainWindow::on_pushButton_clicked()
    QString filePath = qApp->applicationDirPath() + QDir::separator() + "scheme.xml";
    if (!QFile::exists(filePath)) {
    QFile::copy("://scheme.xml", filePath);
    QString data;
    QFile file(filePath);;
    data = QVariant(file.readAll()).toString();

    BTW, I'm using Qt 5.1.0 & Qt Creator 2.7.2 under Ubuntu 13.04

  • Hello, despite it is for sqlite file, it can be used for all files...on android things work a little bit different:

  • Works like a charm... thanks a lot

  • :)
    we all are glad when we can help each other!

Log in to reply