Problem with HTMLview on Android

Discuss GUI programming with the RapaGUI plugin here
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

Problem with HTMLview on Android

Post 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?
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

Re: Problem with HTMLview on Android

Post 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.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with HTMLview on Android

Post by airsoftsoftwair »

Right, I can reproduce this here. Will be fixed.
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

Re: Problem with HTMLview on Android

Post by PEB »

Thanks, Andreas, for working on a fix for this issue.
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Problem with HTMLview on Android

Post 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
Christos
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

Re: Problem with HTMLview on Android

Post by PEB »

Has anyone figured out a workaround for this problem yet?
Or do we need to wait for the next release of RapaGUI?
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with HTMLview on Android

Post 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.
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

Re: Problem with HTMLview on Android

Post by PEB »

No worries.
Thanks for working to fix this.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with HTMLview on Android

Post 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.
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Problem with HTMLview on Android

Post by plouf »

does the above "fix" also allow executing local javascipt ?
i think you must enabled by code
Christos
Post Reply