@@ -3,36 +3,42 @@ Simple and Low footprint TCP/IP Web Server for Android in Java
33
44This is standalone, multithreaded, almost or No dependancy ! http server in Java with example use in Android.
55
6- # How to use it in Android
6+ ## How to use it in Android?
77
881 . Copy TinyWebServer.java class from src dir to your android project package
992 . Call following from android service or process
1010
11- //call contructor with local ip, port , public html directory path
11+
12+ ``` java
13+ // call contructor with local ip, port , public html directory path
1214 TinyWebServer . startServer(" localhost" ,9000 , " /web/public_html" );
15+ ```
1316
14- # How to write custom api
17+ ## How to write custom api?
1518
16191. Copy AppApis . java from src directory
17202. keep the package name same for AppApis . java like " appapis.queryfiles"
18213. open AppApis . java and write your own mehtod/ function inside AppApis . java
1922 for example,
20-
23+
24+ ```java
2125 public String myfirstapi(HashMap qparms){
2226 // todo - write your api logic here
2327 // qparms is collection of GET and POST parameters
2428 }
29+ ```
2530
2631 you can access this api - > http: // localhost/myfirstapi
2732
2833
2934
30- # How to check demo
31- Run the code and hit browser with http://localhost:9000/helloworld
32- > here port number is 9000
33- > localhost or your device ip address
34- > helloworld is api method inside AppApis.java
35+ ## How to check demo?
36+ - Run the code and hit browser with http: // localhost:9000/helloworld
37+ - here port number is 9000
38+ - localhost or your device ip address
39+ - helloworld is api method inside AppApis . java
3540
3641
37-
42+ Design , Build , Tested by
43+ @github / sonuauti
3844
0 commit comments