PDA

View Full Version : WebView download file



mentalmushroom
16th February 2017, 15:24
I am trying to create a QML-based mobile application for downloading files from the web. As far as I know Qt WebEngine is not supported on Android, therefore I am using WebView instead. I have come to notice that it doesn't provide anything like downloadRequested or downloadFinished. How do I handle download requests?

anda_skoa
17th February 2017, 10:05
The web view is a wrapper around the system web component so maybe these do not expose that functionality on all platforms.

Since Android does not artificially restrict web engines I would not rule out that QWebEngine does actually work. After all it is Chromium based so the base code needs to be buildable on Android.

Cheers,
_

mentalmushroom
17th February 2017, 10:08
Well, If I add webengine module to the .pro file, it claims that the module can't be found.

anda_skoa
18th February 2017, 12:34
Hmm, maybe it so not built by default or it is really not supported at the moment.

I wonder how difficult it would be to extend the WebView integration on Android.

Cheers,
_

mentalmushroom
18th February 2017, 15:18
I read about it here (http://doc.qt.io/qt-5/android-support.html).


I wonder how difficult it would be to extend the WebView integration on Android.
And I, in my turn, wonder how come mobile-oriented QML doesn't provide anything for such a common task? As a desktop developer I have been a loyal Qt adherent for years, therefore it was my first bet for the Android application too. But now I have second thoughts about it as Qt's support of mobile platforms leaves much to be desired...

mentalmushroom
19th February 2017, 08:30
Considering the lack of download functionality in the web view I am thinking of going another way: the system browser will be used for downloading and then this file should be automatically opened with my application. May be inconvenient to switch between two apps, but I don't see a better way as yet.

I have created a separate question for that here (http://www.qtcentre.org/threads/67821-Register-file-type-for-android-application).

anda_skoa
19th February 2017, 12:30
I
And I, in my turn, wonder how come mobile-oriented QML doesn't provide anything for such a common task?

It is a wrapper around a native component, these vary a lot between platforms
I usually don't wonder when the wrapper API is very simple, as this is most often caused by some of the native APIs not exporting some functionality.

In some case there are platform specific extension APIs.

I am more surprised that QWebEngine is not available on Android, as that platform usually does not artifically restrict everything to use a single web browser engine.

Cheers,
_