Search code examples
androidhttplistener

Android, HttpListener


I'm fairly new to Android so my question is how do we create an HttpListener on Android device? My task is to create a listener on one android device and request a contact number from second android device & send the data back n forth. Can any one help me?

E.g: Android Device 1 (Containing Listener)

Android Device 2 (Client) Requesting Url to Android Device 1: http://192.122.1.2:8888/GetContactDetail?id=2 Response Received: "111111111111"

Any suggestion on how to implement this scenario?


Solution

  • This is what I did, thanks to @elevine suggestion, I was able to do it successfully but as suggested by @Peter Knego the limitations are still there. This will work on LAN without any problem.

    Hope this helps someone.

    http://codersapprentice.blogspot.com/2011/09/android-integrate-jetty-server-in-my.html