Page 324 -
P. 324

file transfer over wifi


           Run your app on a real phone


           Now that your app is running successfully on your emulator, it’s time to try it
           on a real phone. This is where things get interesting.
                                                                                             These
           There are many options when it comes to copying your code to a real device:
                                                                                          instructions
                  •   Use file transfer over Bluetooth.                                   do not work
                                                                                          on the
                  •   Use file transfer with a USB connection.
                                                                                          emulator.
                  •   Use the Android SDK’s adb tool with USB.
                                                                               The Android emulator
                  •   Use a file transfer tool over WiFi.                      does not currently support
                                                                               Google’s Android Market,
           Unfortunately, which technique to use (and which work) depends very much   which you’ll need access to
           on your phone.
                                                                               use when following along
          At Head First Labs, we’ve had the greatest and most consistent success with   with the instructions on
           the last option: use a file transfer tool over WiFi.                these pages.





           Step 1: Prepare your computer

           To transfer files securely between your Android phone and your computer,
           enable SSH file transfers by running an SSH server on your computer. How
           you do this depends on the operating system you are running:
                  •   Windows: download one of the many free SSH servers.
                  •   Mac OS X: enable remote logins.

                  •   Linux: install and enable OpenSSH Server.





           Step 2: Install AndFTP on your Android phone
           Use the Android Market on your phone to find and install the AndFTP app.
           This excellent tool lets you transfer files to and from your Android phone over
           FTP, SFTP, and FTPS.
           To use it with the SSH server running on your computer, you’ll want to select
           SFTP as the file transfer protocol within the app, because AndFTP defaults
           to using the FTP protocol.


                                                                                         The AndFTP app is
           Let’s take a look at what’s involved.                                         one of our faves.

           288    Chapter 8
   319   320   321   322   323   324   325   326   327   328   329