Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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);
    file.open(QFile::ReadOnly);
    data = QVariant(file.readAll()).toString();
    ui->textEdit->setText(data+"\nENDED");
    }[/code]

    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:
    "here":http://qt-project.org/forums/viewthread/29855/



  • Works like a charm... thanks a lot



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


Log in to reply