Saturday, October 6, 2012

Transferring Files from a computer to your Android device

Android devices have file systems similar to regular computers. Subject to permissions restrictions, we can transfer files from a computer to a device (connected to the computer by USB) or emulator, or from the device or emulator to the computer. There are several ways to transfer files to an Android device:
  1. Using Eclipse
    Select the DDMS perspective for Eclipse and use the File Explorer tab to select the directory where you want to tranfer a file to (a drawback of using this method is that you can only tranfer one file at a time).
  2. Using the ADB
    You can tranfer entire directories using the ADB command line interface. For example to transfer the entire content of a director to an Android device connected to a Ubuntu computer via the USB port:
    $ adb push <path to directory to copy> /mnt/sdcard/<target directory>
  3. Install an ssh daemon on the Android device and then use sftp from your workstation. For example you can download the free SSHDroid app from the Google market and install it on your device, run the app an find out about the IP address to connect to. Then from a terminal window in Linux you can connect like this (works on Ubuntu 12.04):
    $ ssh -p 2222 root@ip-address-mentioned-in-SSHDroid

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.