wireless doom, skin success, android device bridge

last night i put my laptop in suspend; this morning after un-suspend, wireless didn’t work for fedora. i installed a lot of updates to the OS last night so i guess one of them broke wireless. fabulous. submitting a bug. at least wired network is fine.

total success on the android g1 skins melding. basically, i created two subdirectories, one each for portrait/landscape images. then i merged the two layout files; as everything was pretty explicit in the layout files, my “parts” section consists of three parts: one shared “device” part (which is the display screen), and one part each for landscape and portrait (which just wrapped the rest of the previously separate layout files). i had to specify that the “device” part was rotated and translated for landscape – in portrait, x/y specify the upper left corner of the screen; in landscape where this is rotated, x/y refer to the lower left corner of the screen. also because for landscape the system automatically rotates the dpad effects, i had to re-rotate it to undo that (since everything is explicit and correct in the button layout) as commented in the HVGA layout. now all i need to do is send a copy to the original author and ask him to place it in the creative commons so i can rebrand it :-)

So, I thought for a quick bit of fun I’d try attaching to my phone from my computer (like you can to an emulator). Windows makes you install some USB driver and then reboot – well, the heck with rebooting. Under Ubuntu, you need to do some obscure udev voodoo to connect, but that’s OK. This is all it takes for Karmic Koala (thanks to this post):

$ sudo su -
# cat > /etc/udev/rules.d/51-android.rules
SUBSYTEM=="usb", SYSFS(idVendor)=="0bb4", SYMLINK+="android_adb", MODE="0666"
^D
# chmod a+r !$
# service udev restart

Then I connected my device and it was visible to adb right away. I got a shell on the phone. It’s not a root shell like in an emulator, so there doesn’t seem to be a lot you can do! For instance, the /data directory isn’t readable, so no scoping out databases. You can run top, dmesg, etc. from the /system/bin directory. Maybe I’ll find uses for that. I was hoping maybe there’d be some kind of bridge to open a telnet connection to the console on the device (like on emulator) but I guess that’s not available. If I think about it, makes sense, you don’t want someone’s computer to be able to do much to your phone if you just happen to connect its USB cable.

Connected eclipse to it – only one process is visible, the uploader. But I set my app to debuggable and kicked it over to the phone, and debugging worked great. That’s pretty sweet! Definitely necessary if you’re really using the device interactively. And something that would be useful even if you weren’t planning to do any development: you can do a screen capture of your device from DDMS in Eclipse!

I was thinking that part of the reason people use Java so much is the awesome remote debugging abilities. But then it occurred to me to ask whether other languages do this too. Certainly they do – no particular reason why it shouldn’t be possible. Looks like gdb can do it for the languages it supports, and there are at least some ways to do it for Perl and Ruby, though I’m not clear on whether anybody actually does that – though knowing Ruby someone has an awesome way to debug into Rails apps as they run.

Advertisements

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

%d bloggers like this: