javaandroidandroid-studioserverwebserver

How to create (web)server on localhost with android


I have a question on how to create a localhost (web)server in android application using Java. I use android studio. I would like the server to retrieve files from a specific folder and allow it to work with PHP and JavaScript.

Thank you for your answer!


Solution

  • You can make your own HTTP server using ServerSocket.
    JavaScript is client side, and it is impossible to use PHP in your own Java web server unless you are able to write your own PHP compiler.