Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Quick QuickDownloader For Android



  • Hello I use this library in QML for Android. I have permission and other etc work emulator not real devices. Can you help me ?

    Request permission

        QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync(QStringList({"android.permission.WRITE_EXTERNAL_STORAGE"}));
        if(resultHash["android.permission.WRITE_EXTERNAL_STORAGE"] == QtAndroid::PermissionResult::Denied) {
            emit requestResult(false);
        } else {
            emit requestResult(true);
        }
    

    Find Download Path

        QString path = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
        emit getDownloadPath(path);
    
    arm64-v8a.so: qml: /storage/emulated/0/Download
    

    Write

    downloader.destination = "file:///"+downloadPath+"/"+searchBar.text+".jpg"
    downloader.url = profileImage.source
    downloader.running = true
    
    arm64-v8a.so: qml: Permission denied
    


  • Solved add androidmanifest.xml

    android:requestLegacyExternalStorage="true"


Log in to reply