Android

From eBabel wiki
Jump to: navigation, search

Basic tutorial

To get started, follow the Hello World tutorial.

Note: Make sure the device targeted is 2.1 (API 7) because later versions, as of now, are harder to work with. 2.1 for the Android Virtual Device works well, though.

Test and develop with a real Android device

First of all, connect your phone to your computer via USB.

To list the currently attached devices, including the virtual ones:

cd [localpath]/android-sdks/tools
./adb devices

./ means run in current directory.

Your phone is unlikely to already be showing in this list. Yet.

The next step is to find out what is your mobile vendor id and your product id:

lsusb

The result:

Bus 002 Device 007: ID 0bb4:0ff9 High Tech Computer Corp. Desire / Hero
  • 0bb4 is the vendor id
  • 0ff9 is the product id

For old mobiles of the first generation, like mine whose vendor id is 0bb4, create or edit a file in /etc/udev/rules.d called 51-android.rules:

cd /etc/udev/rules.d
sudo gedit 51-android.rules

Add the following line for my particular phone and save it:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

Restart then check again if the mobile device is listed now:

cd [localpath]/android-sdks/tools
sudo adb kill-server
sudo adb start-server
./adb devices 

Source