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.

Comments

  1. sketchware does not pack asset folder apk yet... but it does pack several folders for graphics and sounds.... The one for sounds (raw) can be used to embed a full website and can easylly be called with loadurl... you do not need third part apk editor pro... see my html video player example (website and video are embed amd it works totally offline)

    ReplyDelete
    Replies
    1. Where I can watch the video , I also want to insert the html site into the application.Thanks

      Delete
  2. I saw your method. It is definitely better. Thanks.

    ReplyDelete
  3. Where can we find Particular path of html file in android, because i'm getting Error File Not Found.

    ReplyDelete
  4. Watch the video. It works in new version of Sketchware.

    ReplyDelete
    Replies
    1. I watched the video and try to do it. But i couldnt do. So please help me

      Delete
  5. .sketchware->data->[foldername]->logic file is unreadable/encrypted on kew version. Please help.me

    ReplyDelete
    Replies
    1. Go to .sketchware->resources ->sounds ->[foldername]->soundfile.mp3

      Replace soundfile.mp3 with your html file. Rename your html file as soundfile.mp3.

      Load it in webview.

      Delete
    2. I got folders with css and javascript along with my html file. I want to edit the logic file using droidedit to allow local files but the file seemed encrypted.

      Delete
  6. Thank you so much sir but on click not working in XML can possible ?

    ReplyDelete
  7. Nice Blog.....thanks for this.... Just visit App in Minute can create Application and website without burden. App In Minute has the affordable Pricing and Making Plan by App In Minute of Rs. 5 / Day (Rs.1825/ Year.) It can be develop your free android application , website product and service to the world. for more information about how to create an app

    ReplyDelete
  8. Dimana sy bisa mendapatkan url tv livestreaming online yg outputnya menampilkan layar penuh?

    ReplyDelete
  9. But why the external CSS and Image files does not work on the webview ?

    ReplyDelete
  10. How do you add external files like images?

    ReplyDelete
  11. Can I preview, edit or insert excel sheets on sketchware?

    ReplyDelete
  12. Can I preview, edit or insert excel sheets on sketchware?

    ReplyDelete
  13. Can I preview, edit or insert excel sheets on sketchware?

    ReplyDelete
  14. Sir I couldn't take my html file. Please help me to add my html file for skechware

    ReplyDelete
  15. Does other files work too? Like opening a file inside the app.

    ReplyDelete

Post a Comment

Popular posts from this blog

Simple car racing android game in Sketchware

Creating a Drawing View in Sketchware

Enable Fullscreen for Youtube videos in WebView

How to enable upload from webview in Sketchware?

List of Calendar Format symbols valid in Sketchware