View files from internal storage into web viewer

I need to load images into web viewer from internal storage. How can I do that? I request not to reply to use image component to do it. Only reply to load in web viewer. If it can’t be done using components of Kodular then please inform me about the extension if there exists to do it.
Previously I had an extension that loads file from assets i.e. path to assets made by taifun. So also please inform if there exits such extension which creates path to storage.

try like this, put path as url,

blocks%20(77)

when I set up a local stored HTML-File, the page appears for a second, after that the app tries to use external browser, after deny the webview page is empty.

What is wrong here?

where do you call that procedure?
and which blocks follow after calling it?

Taifun

NewsWebViewer is in NewsComponent.
As I used TaifunTools path_to_asset he gave back error “not able to open PDF”.
But the errorpage.html is not a pdf.

or this

and the LoadNewsComponent comes from:

and this from:

why do you think, that message comes from that method? any screenshot?
also what about debugging your blocks?
modify the path to the html file, use again the PathToAsset method so you will be able to test using the companion app, then connect the companion app, and do a Do it onto the if block


Taifun
2 Likes

Where is this used? Show these blocks.

TaifunTools.PathToAssets returns:

  • file:///mnt/sdcard/AppInventor/assets/ (for Companion)
  • file:///android_asset (for APK)

But the path to assets should be (for Companion):
file:///mnt/sdcard/Makeroid/assets/ or:
file:///storage/emulated/0/Makeroid/assets/

3 Likes

why do you think, that message comes from that method?

Because this behaivior only comes when this block is enabled.

Just to be clear: the errorpage comes for a bunch of milliseconds and disappears immediately. So the path should be ok, otherwise I wouldn’t see my errorpage.html at any time.

These are the screenshots:

(Please ignore the 404-image above, it is my current workaround), the html file begins with description of image “No Internet Connection Image”. As you see, it is there, but the browser selection comes immediately afterwards.
This is the errorpage.html:

<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
	<style>
input {
	width: 239px;
height: 78px;
color: #ea0e0e;
font-size: 50px;
}

h1 {
	font-size: 60px;
	color: red

}
h2 {
	font-size: 30px;
	color: blue;
}
img{
	    width: 285px;
height: 272px;
}
.center {
	align-items: center;
	text-align: center;
}

	</style>
</head>
<body>
<div class="center">
	<img alt="No Internet Connection Image" src="../../../Bilder/FAFNIR2/fc99/nointernet.jpg" style="width: 500px; height: 250px" /></img>
<h2>Etwas ist schiefgelaufen</h2>

<h3>Versuche Sie es später noch einmal!</h3>

</body>
</html>
1 Like

Thanks for looking into it. But I don’t use companion in this special case because of my side menu. Companion crashes too often (I know why). I test it with real .apk to be sure to get the live behaivior.

It occurred to me that I have a process that links that are clicked in the WebViewer are opened via the normal browser of the mobile phone. That bothered all the time.

So I fixed it by an if (connection = false) / then block. Thanks for taking time to help.