Skip to content

Commit a1f4af8

Browse files
authored
Usages
How to use this code for android and java
1 parent 8ba181c commit a1f4af8

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
11
# Android Web Server
22
Simple and Low footprint TCP/IP Web Server for Android in Java
33

4-
This is standalone, multithreaded, no dependancy http server in Java with example use in Android.
4+
This is standalone, multithreaded, almost or No dependancy ! http server in Java with example use in Android.
5+
6+
# How to use it in Android
7+
8+
1. Copy TinyWebServer.java class from src dir to your android project package
9+
2. Call following from android service or process
10+
11+
//call contructor with local ip, port , public html directory path
12+
TinyWebServer.startServer("localhost",9000, "/web/public_html");
13+
14+
# How to write custom api
15+
16+
1. Copy AppApis.java from src directory
17+
2. keep the package name same for AppApis.java like "appapis.queryfiles"
18+
3. open AppApis.java and write your own mehtod/function inside AppApis.java
19+
for example,
20+
21+
public String myfirstapi(HashMap qparms){
22+
//todo - write your api logic here
23+
//qparms is collection of GET and POST parameters
24+
}
25+
26+
you can access this api -> http://localhost/myfirstapi
27+
28+
29+
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+
36+
37+
38+

0 commit comments

Comments
 (0)