Yuval Dryer

08/15/2021, 4:04 PM
Hi All, I'm trying to run a Ktor server on android but cannot get the static webpage to display on the browser. I've added an assets folder and place the website as a subfolder in it, The request is recognized but the path I give in the response always seems to be wrong. Any ideas what I'm doing wrong?


08/15/2021, 10:16 PM
you want to run a server on an android phone?
does it work on a server?

Yuval Dryer

08/16/2021, 3:06 PM
yes, I followed the embeddedServer example to launch a server. It works well, from my PC (if I know the IP address) I can access the server and receive simple responses. Debugging through the app I can see that I can also add longer path so supporting restful API is not a problem. However returning an HTML page, that page that the user needs to see when browsing to the device does not work. I tried following the examples of returning static content but cannot get it to work. From what I can see it's an issue with the path to the assets folder that might not work for android.