I want to open a file (.xls, .pdf, .png, etc.) using QML on Android (if iOS works even better).
I'm trying to use it like this:
Qt.openUrlExternally(url)
/*Qt.openUrlExternally("http://www.example.com)"*/
/*Qt.openUrlExternally("file:///C:/Users/Hello/Pictures/Qt.jpg")*/
Both the Internet URL and the Local URL open perfectly on Windows. The Internet URL works also on Android, however I can't open a local file on Android.
This is what I've tried on Android:
Qt.openUrlExternally("file:/storage/emulated/0/Documents/test_pdf.pdf")
Qt.openUrlExternally("file:///storage/emulated/0/Documents/test_pdf.pdf")
Qt.openUrlExternally(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/test_pdf.pdf")
Qt.openUrlExternally("content:///storage/emulated/0/Documents/test_pdf.pdf");
I know there's a couple questios about this on here but no one answered me and also the example don't show how to open a local file.
I have Storage permission BTW and the file it's there for sure.
edit: if I pick the file through QMLs fileDilog this is the URL I get: content://com.android.externalstorage.documents/document/primary%3ADocuments/%2F20BLOQUES.pdf