Quick question:
Is there a way to have WebView embed an entire local or offline website (a folder containing all the html files, images, pdf files, java scrip add-ons, etc.) into my app? Webview cannot do it? Is there another way?
I do not mean accessing a local folder. I mean importing a folder containing my entire web site (with all its structure) into my app, and then compiling my app (end size of the app does not matter to me).
For example, I have an app for which I made a help “activity module”. In that “Help” activity, I imported an html file with some graphics using WebView. To make the html file open the jpg file, I had to manually add the “assets” folder image location within the future compiled app into the html code for that one image. Can you imagine how troublesome would it be if I have more than 100 images? And I do for my next project. I would have to manually add the image location of the assets folder into the html code for each image…
I design websites as one of my duties at work, but now, I have to embed the whole website (folder with images, pdf files, zip files, java add ons, etc) into my app.
Here is the code I used for the Help activity module of one of my apps using WebView, and it works flawlessly (just the wrap around when zooming beyond the image size is not as I desire…), but this way would be too painful if importing a whole website folder:
Thank you, in advance.
Is there a way to have WebView embed an entire local or offline website (a folder containing all the html files, images, pdf files, java scrip add-ons, etc.) into my app? Webview cannot do it? Is there another way?
I do not mean accessing a local folder. I mean importing a folder containing my entire web site (with all its structure) into my app, and then compiling my app (end size of the app does not matter to me).
For example, I have an app for which I made a help “activity module”. In that “Help” activity, I imported an html file with some graphics using WebView. To make the html file open the jpg file, I had to manually add the “assets” folder image location within the future compiled app into the html code for that one image. Can you imagine how troublesome would it be if I have more than 100 images? And I do for my next project. I would have to manually add the image location of the assets folder into the html code for each image…
I design websites as one of my duties at work, but now, I have to embed the whole website (folder with images, pdf files, zip files, java add ons, etc) into my app.
Here is the code I used for the Help activity module of one of my apps using WebView, and it works flawlessly (just the wrap around when zooming beyond the image size is not as I desire…), but this way would be too painful if importing a whole website folder:
B4X:
Sub Process_Globals
End Sub
Sub Globals
Dim HelpWebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Help1")
myHTML = File.ReadString(File.DirAssets, "Help.html")
HelpWebView1.LoadHTML(myHTML)
HelpWebView1.Color = Colors.Transparent 'Makes page background transparent in the Virtual Designer
End Sub
Thank you, in advance.