i am trying to load the attached html game since it doesn't work directly on webview unlesss it is served from a server. My Code is as below (the rest of the code is as in the example httpserver project):
Sub GetTemplate(Name As String) As String
If templates.ContainsKey(Name) Then Return templates.Get(Name)
Dim temp As String = File.ReadString(File.DirInternal&"/"&Main.linkname, Name)
Log("temp"&temp)
templates.Put(Name, temp)
Return temp
End Sub
Sub HandleMainPage (Response As ServletResponse)
Dim MainPage As String = GetTemplate("index.html") 'load the template from the assets folder
Response.SetContentType("text/html")
Response.SendString(MainPage)
End Sub
then on the webview it is as below:
StartService(ServerService)
Sleep(4000)
Dim ssocket As ServerSocket
WebView1.LoadUrl(ssocket.GetMyWifiIP & ":" & ServerService.port)
After running this, I get the below error:
Error serving request: (FileNotFoundException) java.io.FileNotFoundException: style.css
Error serving request: (FileNotFoundException) java.io.FileNotFoundException: scripts\main.js
Error serving request: (FileNotFoundException) java.io.FileNotFoundException: scripts\supportcheck.js
etc for each file in the project
html project file=>
html project