Local web page in webiew

tremara1

Active Member
Licensed User
Longtime User
I am struggling with the syntax for loading a local html page into webview. The web page is in files folder of the project. Do I have to copy it to the SD card first?.....thanks
 

tremara1

Active Member
Licensed User
Longtime User
thanks......again

There is a lot to learn........thanks for your patience
 
Upvote 0

aklisiewicz

Active Member
Licensed User
Longtime User
I copied HTML file into the Files folder and added it to the FILES Tab.
I'm trying your suggestion, but I get "Page not found Error"

B4X:
Sub Globals
  Dim WebView1 As WebView
  Dim BtnMain As Button
  Dim url As String
  url = "file:///android_asset/YL_intro.html"
End Sub

Sub Activity_Create(FirstTime As Boolean)
  Activity.LoadLayout("Intro")
  WebView1.Initialize("WebView1")
  Activity.AddView(WebView1,0dip, 0dip, 100%x, 100%y)
  WebView1.LoadUrl(url)
  ProgressDialogShow("Loading " &url)
End Sub

Arthur
 
Upvote 0
Top