How does my Android device connect over wifi
A feature of AppInventor allows users to connect a device to a PC over wifi to test their apps. Below we explain in more detail how this process works.
To use the AppInventor connection over wifi, a user must download the MIT AI2 Companion App via the Google Play Store (note: AI1 users should get the v1 companion, not the v2), and install it directly to your phone (note that to directly install, you will need to allow installation of non-market apps in your device's system settings). Directly loading App Inventor in this way means that the Play Store can not automatically update the App. When there is an App Inventor upgrade, you will need to manually update the Companion App.
The MIT AICompanion allows a user to make a connection between the Android device and PC over the MIT RendezVous Server.
The Android device must be using Wifi and not the cell network for Internet connectivity.
How MIT RendezVous Server works
1. Your PC checks in with a 6-character code generated by the MIT AICompanion
2. MIT RendezVous Server records the IP address of your PC
3. Your Android device checks in with a 6-character code
4. MIT RendezVous Server records the IP address of your phone
5. MIT RendezVous Server tells the device and computer with the matching 6-character code the other's IP address
6. Device and computer communicate directly using IP
Ideally our network situation should look like this:
Connecting over the Phone Over Wifi Troubleshooting
Try the following steps to troubleshoot your wireless connection.
1. Try to reach http://rendezvous.appinventor.mit.edu from your PC
2. Try to reach http://rendezvous.appinventor.mit.edu from your Android device
3. If the steps above both work, try using the "ping" command to ping to the IP Address of the phone (displayed by the MIT AICompanion in its startup window). If you are using windows, type "ping" + *IP address of the phone* in cmd.exe window, if you are using mac or linux, type type "ping" + *IP address of the phone* in terminal window. Detailed instruction see http://www.wikihow.com/Ping-an-IP-Address
4. If all of these steps succeed and Wireless App Inventor still doesn't work, then there may be a firewall between the computer and phone that is blocking ports 8001 and 9987. If you have a "telnet" program you can attempt to telnet from the computer to the phone on these ports. If the connection won't complete, then there is likely a firewall in place that is blocking connections to the phone
If you do not pass step 4, your network most likely looks like this.
Many networks have firewalls set up that block connections to the phone. A way to get around this is to use your own or a local computer as a wifi router and have all computers and devices using AppInventor connect to the network using the new router. For detailed instruction setting up a computer as a router, see http://www.wikihow.com/Create-a-Wireless-Network
Why is my phone still not connecting?
Check that your device is connected to Wifi and not the cell network. On some devices and in some locations, even with WiFi enabled, the phone continues to use the cell network. If this is happening to you, you can disable mobile networking (cell phone carrier based Internet connectivity) from your device's Android settings menu.