Back to project page android_opengles.
The source code is released under:
MIT License
If you think the Android project android_opengles listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package fi.iki.elonen; /* www. j av a2s . c om*/ import java.util.Map; /** * An example of subclassing NanoHTTPD to make a custom HTTP server. */ public class HelloServer extends NanoHTTPD { public HelloServer() { super(8787); } @Override public Response serve(IHTTPSession session) { Method method = session.getMethod(); String uri = session.getUri(); System.out.println(method + " '" + uri + "' "); String msg = "<html><body><h1>Hello server</h1>\n"; Map<String, String> parms = session.getParms(); if (parms.get("username") == null) msg += "<form action='?' method='get'>\n" + " <p>Your name: <input type='text' name='username'></p>\n" + "</form>\n"; else msg += "<p>Hello, " + parms.get("username") + "!</p>"; msg += "</body></html>\n"; return new NanoHTTPD.Response(msg); } public static void main(String[] args) { ServerRunner.run(HelloServer.class); } }