Friday, June 19, 2015

Display Android Device Screen on Fedora for Feedhenry Application

I wanted to display my Android screen on Fedora during a Summit presentation which includes Feedhenry.  I found an easy way to mirror my android screen on Fedora so I can show it through the presentation device (TV, Projector, etc.).  So I compiled the steps below from some different references.
  • Download the latest Android SDK from Google: Android SDK
  • Extract the TGZ file to your home/YOUR-USERNAME directory
  • To get ADB, you need to install the SDK: Installing the SDK 

    • Run chmode on android in tools
    • Run android under tools and then install the Android SDK Tools
  • On your phone turn on Debugging in Developer Settings, click Settings > Developer Options turn on debugging and make sure USB Debugging is on.
  • If you are running 64-bit then to run adb you will have to enable 32-bit
    • # yum install glibc.i686
    •  #yum install zlib.i686 libstdc++.i686 ncurses-libs.i686 libgcc.i686
  • You need to add a udev rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer is identified by a unique vendor ID, as specified by the ATTR{idVendor} property. For a list of vendor IDs, see USB Vendor IDs,  To set up device detection on Linux:
    • Log in as root and create this file: /etc/udev/rules.d/51-android.rules.
      Use this format to add each vendor to the file:
      SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"

      [summit2015@localhost tools]$ cat /etc/udev/rules.d/51-android.rules
      SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
      [summit2015@localhost tools]$

      Note: The rule syntax may vary slightly depending on your environment. Consult the udev documentation for your system as needed. For an overview of rule syntax, see this guide to writing udev rules.

    • Now execute:
      chmod a+r /etc/udev/rules.d/51-android.rules
  • When plugged in over USB, you can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you'll see the device name listed as a "device."
[summit2015@localhost platform-tools]$ ./adb devices
List of devices attached
0A3D267016016004    device

[summit2015@localhost platform-tools]$

NOTE: I ran android update adb and adb server-start to test prior to the above command but these shouldn't be required
  •  Next  I download Droid@Screen and then ran java -jar droidAtScreen-1.1.jar