First off, you're confusing the network stack or what I originally learn as the 7 layer OSI model. The wifi connection is down in layer one and typically when you're writing software you don't go anywhere near this layer.
Software usually connects at levels 5 and above. The java.io package provides the classes needed to do this, leaving you to decide whether to work with a direct socket connection or use on of the protocols in the higher levels such as http.
My advice would be to use http as your protocol with Tomcat or similar as your server, putting the logic you need in servlets or JSPs as appropriate. Sending http requests from Andriod is explained here.