Using Hardware Devices while developing and Android Application

Many developers are using the emulator provided by Android SDK in order to test the application that they develop. There is although an other part of developers who wants to run the application in their device (android,tablet etc). So what happens in this case?The solution to the problem is very simple. By having a look on android developers documentation [1]  we can follow the steps given and emulate the application we develop in the device we wish.

“3) Set up your system to detect your device.

  • If you’re developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
  • If you’re developing on Mac OS X, it just works. Skip this step.
  • If you’re developing on Ubuntu Linux, 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, below. To set up device detection on Ubuntu Linux:
    1. 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}=="0bb4", MODE="0666", GROUP="plugdev"

      In this example, the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.

      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.

    2. Now execute:
      chmod a+r /etc/udev/rules.d/51-android.rules

It is very important to find the Vendor ID of your device . In order to do that just have a look at the following part . This part provides a table with companies and vendor id’s

USB Vendor IDs

This table provides a reference to the vendor IDs needed in order to add USB device support on Linux. The USB Vendor ID is the value given to the ATTR{idVendor} property in the rules file, as described above.”

 

Company USB Vendor ID
Acer 0502
ASUS 0b05
Dell 413c
Foxconn 0489
Fujitsu 04c5
Fujitsu Toshiba 04c5
Garmin-Asus 091e
Google 18d1
Haier 201E
Hisense 109b
HTC 0bb4
Huawei 12d1
K-Touch 24e3
KT Tech 2116
Kyocera 0482
Lenovo 17ef
LG 1004
Motorola 22b8
MTK 0e8d
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10a9
Pegatron 1d4d
Philips 0471
PMC-Sierra 04da
Qualcomm 05c6
SK Telesys 1f53
Samsung 04e8
Sharp 04dd
Sony 054c
Sony Ericsson 0fce
Teleepoch 2340
Toshiba 0930
ZTE 19d2

 

Plug in your device, configure it and then  enjoy your application!!

Reference :

[1] http://developer.android.com/tools/device.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s