Connect Android to Computer: Difference between revisions

From Info Wiki
Jump to navigationJump to search
(→‎Digging Deeper: added other packages required for some Linux)
Line 46: Line 46:
#*if not available as component then install full SDK
#*if not available as component then install full SDK
#**large download
#**large download
#install other packages required
#*nil - for openSUSE
#*udisks2 & kio-mtp for Archlinux running KDE
#download the droid@screen java applet from http://droid-at-screen.ribomation.com/download/
#download the droid@screen java applet from http://droid-at-screen.ribomation.com/download/
#save it in a user executable location
#save it in a user executable location

Revision as of 00:32, 2 June 2014

This article is based on limited experience with one device, and will need additional information to cover a wider range. Please add what you know, or let me know and I will edit the wiki for you: Paul.

Connecting an Android device to a computer

It's a connected world, and setting your devices to communicate with each other can make their use even easier, more useful and more fun. It can make the job of moving files – music, photos etc - more intuitive and positive.

The first task is to connect your computer to your Android device to allow you to move files between them. You can do this wirelessly if you have a wireless router, or physically using the cable you use for recharging your device (most devices have a USB-type cable that plugs into a host device or a power point).

Wirelessly

Fig. 1

Wireless provides a range of features. For example, you can use the connection to send SMS messages from the keyboard of your computer (much easier than the small keyboards!). But most usefully, you can control your phone from a distance - which, if you lose it, might just be a life saver.

There are numerous packages to choose from, but AirDroid is the pick of them at the time of writing. Do a Google search for AirDroid on your device and install it. Connection is via your browser. The phone install will give you a URL - something like 10.0.0.9:8888 (the URL will depend on your router), and away you go. That's it!

Physically

Fig. 2

As mentioned above, most devices have a cable that serves a dual role – recharging, or connecting to a computer.

If you connect the two, Mac and Linux machines will know about this added device automatically. Windows users will probably have to install a device driver in the same way that you would for any other device. The way you do this will depend on the host device, but the process has been largely automated now, needing no special action on your part.

Windows 8 may not find your driver. Experience shows that HTC drivers are available and do work for many Android devices. There is a useful thread at http://forum.xda-developers.com

Bear in mind that you will probably have to reset your computer and then connect your device for this to work after the driver has been installed. When you have done that, go to Settings/More... and turn on the Tethering/Hotspot feature.

When you have done with tethering, reverse the process and turn it off.

Digging Deeper

You have been asked to demonstrate your new device to a room full of new owners, and would like to illustrate actual screenshots to complement your talk. Not all devices have an HDMI port, so you need an alternative.

Some techniques require

  • Android app and/or
  • WiFi connection between PC & Android device

The following technique requires neither of the above, but does require a USB connection between the devices

  • works with Android in Portrait or Landscape mode, with latter usually better
    • Landscape usually increases font and
    • makes more use of Projector screen

Linux

  1. check that Java is installed
    • if not use software manager to install
  2. install the adb component of Android SDK
    • if not available as component then install full SDK
      • large download
  3. install other packages required
    • nil - for openSUSE
    • udisks2 & kio-mtp for Archlinux running KDE
  4. download the droid@screen java applet from http://droid-at-screen.ribomation.com/download/
  5. save it in a user executable location
  6. power up Android device
  7. navigate to Settings
  8. change Developer settings as detailed at http://droid-at-screen.ribomation.com/installation/
  9. connect Android device to PC via USB cable
    • most Linux should automatically detect the Android device
  10. execute
    • $ java -jar <path-to>droidAtscreen
  11. a pop up window should request location of adb
    • browse to /usr/bin/adb (in openSUSE)
    • select
  12. a GUI screen should pop up
    • Android device should be listed in device table
    • select it
  13. screen display of Android device should appear in a separate window on PC
    • window can't be enlarged beyond resolution of Android device - usually # > 1280 x800

Refinements

  • add java applet to desktop menu
  • add path to adb to environment variable ANDROID_HOME

Windows

Before you even contemplate installing this, you can only make this work if you have Java (at least v6) installed.

There is a long-winded or, alternately, a relatively modest way of proceeding. The long-winded way is to get the entire Android Software Development Kit (SDK)– fine if you plan to write apps, but at 660MB, a bit extreme. The modest way is only (!) 93MB so go to http://developer.android.com/sdk/index.html.

Fig. 3

If you are using Windows, scroll down a bit and find “Use an existing IDE” and then click the button “Download the SDK Tools for Windows.

If you are not using Windows, there are download options for Mac and Linux. Download just the SDK tools, you won’t need the ADT ones.

That’s the typical result on a Windows screen when you download and unpack the zip file. Now you can click on that, and sit back for a few moments while the installer gets busy. Make a note of the directory it is installed in.

All you need to check at this point is that the platform tools are installed. If not, make sure they are (tick the box and follow the on-screen prompts)

Fig. 4

The next step is to set up an environment variable to point to the SDK directory (you did make a note of it?) If not, take a look at the image above, and you will see it there.

In Windows, press the Microsoft/Windows key together with the Pause/Break key to get to the Properties screen (or right-click your Computer desktop icon and select Properties). At the left, click on ‘Advanced system settings’ select the Advanced tab, then click the Environment Variables button. Click on New, type ANDROID_HOME in the Variable box, and enter the path which will probably be something like c:\program files\android\android-sdk in the Value box. Say OK to all that.

I'm unsure what you would need to do in Linux/Mac Does anyone know?

Now, over to your Android device. Find Settings, and then Developer options.

Fig. 5

Tap that, and then find and tap USB debugging to turn it on.

Fig. 6

Connect your Android device to your computer with a USB cable. This will change a few items on your device, and you need to respond. In Settings, find the USB connection pointer and activate it.

Fig. 7

Now back to your computer. Go to http://droid-at-screen.ribomation.com/download/ and download Droid@Screen. This will be a .jar file – simply copy it to your desktop.

Double click on the .jar file, wherever you put it. If Droid@Screen cannot find the ADB executable you created, it will prompt you for the path. Just navigate to the installation directory of the Android SDK and then into platform-tools. You should find the adb.exe file there.

That's the setup finished. You could create a desktop icon for the .jar file, so that you could connect your device then click the icon to get a screen view open.