How can read a external html file using file component?

i know that file component only read txt files but i need a extension for read html file and get image using webviewer?

Essentially an HTML file is a text file, but images are often linked to (stored separately on a Server) and not embedded in the file.

Please tell us exactly what you wish to achieve and where exactly you get the HTML file from.

i am trying to load a game but not store inside assets. only using filecomponent read. this game have mp3 files, css files, images files and javascript files

By load, do you mean you want it to be part of your App or do you mean it should be possible to play the game via your App?

You can obviously view the file in a WebView component. If you use the extension Custom Web View, possibly you can play the game.

Where is the HTML file and it's dependency files?

the files are inside a file storage in my phone. so i need to read the files that are in my phone storage for load the html, images,sound and javascript files for get a display in the webviewer.

The JavaScript and media files should all be linked in the HTML file so to play the game, set the path of the CustomWebView to where the files are stored. They should all be in the same folder, but where did you get them from? The HTML may be expecting the dependency files (media and JavaScript) to be elsewhere. Also, Apps are limited as to what folders on the device they can read (Google Security Measure).

Here is an example that stores a simple HTML file inside the App, in Media (Assets). You can likewise store the HTML file outside of the App, but I have an inkling that Android does not regard HTML files as media, which might be a problem.

CustomWebExample.aia (78.7 KB)

Let's assume, the files are stored in shared storage, for example in
file:///storage/emulated/0/Download/myFolder/index.html

What happens, if you use the Webviewer.GoToUrl method together with that path?

Taifun

1 Like