问题
Ive seen some apps where you can open your computers web-browser, type in the local IP address to the android device, and access a homepage that hosts from the device.
An example is this app: Finger Timer - play.google.com
Does anyone know how this is done? Does Google have an API for this, or do you have any examples that I can start with? Im not a professional developer, so I prefer to keep it simple (few technologies).
What I had in mind was something like this:
- Create a HTML or PHP page on my device
- Feed it with some information from my app somehow
- Host that page, so it can be accessed from any web-browser on any device on a local network.
回答1:
" Paw Server" does that.
Here's some documentation on how to use it.
- check out this thread at XDA-Devs which explains the process. http://forum.xda-developers.com/showthread.php?p=9893301
- on Google Play
- PawServer Homepage
回答2:
I found this page that is amazingly good. Just what I was looking for. It even has source code, so this is how I can learn faster. Android Development Blog It contains, as the blogger says: "a bare minimum web server for android platform".
来源:https://stackoverflow.com/questions/13087828/use-android-as-webserver-on-local-network