Android Question Webview Load HTML Project directory www

jsaplication.mobile

Member
Licensed User
before in version 8 of b4a i managed to load an html project in the folder i created in Files using webview1.loadUrl("android_assets/www/index.html") but now in version 9 to 11 the error and the webview cannot load the html nor find the directory and before everything worked including the html files like css and js and image without having to use android_assets inside the html would I be able to do what I did before in the b4a 11 versions
 

drgottjr

Expert
Licensed User
Longtime User
i don't know exactly what you did before, but this still works:
B4X:
Dim xui As XUI
webview.LoadUrl(xui.FileURI(File.DirAssets, "www\index.html"))
End Sub

but if you're trying to run a kind of local web "server" using webview and with css, images, js scripts and other html files loaded by files located in the assets subfolder, you are in for much head banging.
you may want to look into post #5 from here: https://www.b4x.com/android/forum/threads/webview-file-dirassets-enough-already.137803/#content
 

Attachments

  • cap.png
    cap.png
    13.6 KB · Views: 84
Upvote 0
Top