The first step in programming Android is to download the Android SDK: http://developer.android.com/sdk/index.html
On Ubuntu Linux, I downloaded the SDK into the home directory, and unzipped / untarred it. The next step is to get the Beagle Android Gadget Pack recognizing on the USB port. The next step involves plugging a USB cable into the side of the gadget. Once it's in, run the command:
lsusb
I get a bunch of Bus 001 through Bus 005, followed by Device blablabla information. Here's the trick. You want to find the ID of the Android device, so run lsusb while the device is unplugged, and then run it again. On my computer, the line that changes when the Android gadget is plugged in is:
Bus 001 Device 004: ID 18d1:9018
Ok. Now create a file called "51-android.rules". See the part in the line above that says, "18d1"? and "Device 004"? That's idVendor and idProduct respectively. So change those values in the file content below:
Then copy the file here:
SUBSYSTEMS=="usb"
ATTRS{idVendor}=="18d1",
ATTRS{idProduct}=="0004",
MODE="0666"
/etc/udev/rules.d/51-android.rules
This is a rather convoluted and manual way to get the Ubuntu Linux OS recognizing the Android Gadget as a native Android device. Now, you can cd into the SDK directory, and type:
./adb devices
And the device should show up. This is what I get:
List of devices attached:Now I can use this command to get access to the Android Shell:
20100720 device
./adb shell
You'll get kicked out directly to the Android root command line, where you'll notice you can use ls, cd, cp, mv, rm, and cat. And that's about it. No text editor, no vi, no nothing. Pretty limited. Likely, you'll want to copy files on and off of the Android gadget, so you'll typically use these commands that come along with the Android SDK:
./adb push your_file to_location_on_androidAnd most importantly... if you have an APK downloaded or compiled for Android, and you want to install it, just use:
./adb pull path_to_file_on_android
./adb --help
./adb install blabla.apk
Voila!
1 comment:
hi, I am very interested in your article, Can me to share re your article on my site?
Post a Comment