title: How to control an Arduino and WiFly shield with an Android device
body: <p>I'm trying to control an <a href="http://arduino.cc/en/Main/ArduinoBoardUno" rel="nofollow">Arduino Uno</a> R3 board + <a href="https://www.sparkfun.com/products/9954" rel="nofollow">WiFly RN-131C shield</a> with the use of my Android phone (that is, something similar to what is shown <a href="http://www.youtube.com/watch?v=cxYo-rx89Y4" rel="nofollow">here</a>, although I think in that case the Arduino connects to the network through an Ethernet shield).</p>
  
  <p>The Arduino can connect to my local network through the WiFly shield and the Android phone is also connected to the same network.  </p>
  
  <p>I have been trying to look for some tutorial that does something similar (unfortunately the link for the tutorial given in the video above is broken), and I have found some, but I am having trouble with the step on how to send the commands from the Android phone to the Arduino. Many tutorials show how an Android phone and Arduino can communicate via Bluetooth or <a href="http://www.cellbots.com/resources/getting-started/" rel="nofollow">using two Android devices</a>, but I'm looking for communication over the <a href="http://en.wikipedia.org/wiki/Wi-Fi" rel="nofollow">Wi-Fi</a> local network.</p>
  
  <p>For example, I found this nice instructable on a <a href="http://www.instructables.com/id/How-to-build-an-Arduino-WiFi-4x4-with-Android-Cont/?ALLSTEPS" rel="nofollow">4x4 Remote Control car</a>, and the guy was kind enough to provide <a href="http://www.instructables.com/files/orig/F4M/JD8F/GK0YV2SQ/F4MJD8FGK0YV2SQ.zip" rel="nofollow">the source code for his Android application</a>. However, I do not see in the code the place where the actual communication takes place (that is, where commands are sent).</p>
  
  <p>From what I have read, I have to create a socket over a TCP connection, but I have no idea of how that is done in Android... :-/
  I am new to Arduino, but I have some experience with Android programming.. except for working with web sockets and TCP!</p>
  
  <p>What is a concrete sample code on how an Android phone can communicate through TCP with an Arduino?</p>
  
  <p>PS: Another nice tutorial that does something similar can be found in <em><a href="http://blog.mawqey.com/2011/01/24/experimenting-with-android-and-arduino/#TCP_To_Serial_Communication_Server" rel="nofollow">Experimenting with Android and Arduino</a></em>, but I don't know Python and cannot completely follow the instructions :( </p>