ESP8266

I added a UDP example: GitHub - Paulware/ESP8266: All things related to ESP8266 low cost device. It is written for the mega since the ESP8166 needs commands over a fast serial port.

Basic theory of UDP operation:
ESP8266 logs onto your local network (it will need SSID and password)
Android device also logs on to local network and sends out a UDP broadcast (to 192.168.0.255 for example). The message is "findkey" where key is a unique name of the device (i.e. garageDoor).

All other ESP8266 on the local network will receive this message but only the unit with the matching key will respond. This matching unit will respond: "CTS" (clear to send) to the android device.

When the android device receives this message it now also has the ip address of the device. All further commands will be point to point from the android device to the specific ip address of the specific ESP8266 unit with the matching key.

The unit can now process and respond to commands, like "open" or "readTemp".

In the ESP8266UDP directory is also a udpServer.py file which can be used to simulate and android device (if you don't yet have one - The Kyocera Event can be purchased at Best Buy for $40) to command the ESP8266.

Also, in this directory is an Android project written in .java/Eclipse which demonstrates basic connectivity. You can use this project as a skeleton to create your own Android App.