Page 1 of 2

Problem with HTMLview on Android

Posted: Fri Sep 23, 2022 11:58 pm
by PEB
Is anyone able to use the HTMLview class on android devices? Even just using the HTMLview example from the RapaGUI package doesn't work for me. I always get:

"Webpage not available"
"net::ERR_CLEARTEXT_NOT_PERMITTED"

In the past, I had gotten around this by adding...

Code: Select all

android:usesCleartextTraffic="true"
...to the manifest in the APK compiler; but now that doesn't seem to help.

Any ideas?

Re: Problem with HTMLview on Android

Posted: Sat Sep 24, 2022 8:57 pm
by PEB
Update:
The website for wikipedia ("http://www.wikipedia.org/") does load, but no other website seems to work.
Also, local .html files do not display either.

Re: Problem with HTMLview on Android

Posted: Sat Sep 24, 2022 11:38 pm
by airsoftsoftwair
Right, I can reproduce this here. Will be fixed.

Re: Problem with HTMLview on Android

Posted: Sun Sep 25, 2022 2:56 am
by PEB
Thanks, Andreas, for working on a fix for this issue.

Re: Problem with HTMLview on Android

Posted: Sun Sep 25, 2022 7:39 am
by plouf
If htmlview in android tweaked
There are some other "tweaks" to enable javascript and loading local files whre would be very handfull if they also implemented

Re: Problem with HTMLview on Android

Posted: Fri Mar 29, 2024 6:41 am
by PEB
Has anyone figured out a workaround for this problem yet?
Or do we need to wait for the next release of RapaGUI?

Re: Problem with HTMLview on Android

Posted: Mon Apr 08, 2024 7:44 pm
by airsoftsoftwair
I'm afraid I don't see how this can be worked around. But in the next version it'll hopefully be fixed.

Re: Problem with HTMLview on Android

Posted: Tue Apr 09, 2024 10:49 am
by PEB
No worries.
Thanks for working to fix this.

Re: Problem with HTMLview on Android

Posted: Sun Aug 18, 2024 9:33 pm
by airsoftsoftwair
I've done some research and tried it myself. I don't think I can do anything against the way HTMLview behaves on Android but I do managed to get it to open all websites by setting "android:usesCleartextTraffic" to "true" in the manifest. Are you sure that this is really not working for you? It seems to work here.

Without setting "android:usesCleartextTraffic" to "true" only sites work that use HTTPS instead of HTTP, with the exception of Wikipedia maybe. So you could also work around problems by simply prefixing URLs with https:// prefix instead of http:// Most websites are available as HTTPS anyway nowadays.
PEB wrote: Sat Sep 24, 2022 8:57 pm Also, local .html files do not display either.
How do you try to show local files? Since all apps run in a sandbox it's very difficult to access local files from within your apps. I don't think there's any way to access files outside the app using the HTMLview widget. AFAIU it's only possible to show local files that are stored as assets in your APK, e.g. like this:

Code: Select all

moai.Set("htmlview", "url", "file:///android_asset/filename.html")
Showing any local files OUTSIDE the project's asset folder isn't really possible at all I think.

Re: Problem with HTMLview on Android

Posted: Mon Aug 19, 2024 6:40 am
by plouf
does the above "fix" also allow executing local javascipt ?
i think you must enabled by code