Qt Quick QuickDownloader For Android
Solved
Mobile and Embedded
-
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"