File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 11# Android Web Server
22Simple 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+
You can’t perform that action at this time.
0 commit comments