How to insert a HTML file into a Sketchware app

How to insert HTML file in an app created in Sketchware?

Suppose you have created an HTML file using HTML, CSS and JavaScript, and you want to create an Android app where you can view this html file. You can easily do this by following the steps given below.

1. Add a WebView webview1 in VIEW area of your android project in Sketchware.

2. Through sound manager add a sound file to your project (e.g. button.mp3).

3. Save project and exit.

4. Go to file manager and copy your HTML file (myfile.html).

5. In sdcard, navigate to .sketchware/resources/sounds/(your project no.)/ and paste the HTML file in the this folder.

6. Delete the sound file (button.mp3), and rename the html file (myfile.html) to same as the sound file (button.mp3). Thus myfile.html is renamed button.mp3.

7. Open the project again in Sketchware, and in onCreate event, use the Block
WebView loadUrl........,
and put following path in it:
file:///android_res/raw/button.mp3
Or
file:///android_res/raw/button

Here button.mp3 is the name of the sound file which was replaced by HTML file. It has to be changed according to your file name.

8. Save and run the project. You will see your HTML file load in WebView. All the CSS and JavaScript used in the HTML file work too.

Watch the video below to understand better:

The same method can also be used for inserting a gif image in Sketchware, for displaying in WebView.