Tuesday, January 31, 2012

Javascript in Eclipse

The problem: In Eclipse on my Windows machine at work, I get an error attempting to open Javascript files, and have to open them as plain text.

After a bit of Googling around, I ended up using the JSEditor plugin. There doesn't seem to be an update site for it, so I downloaded it from

http://sourceforge.net/projects/jseditor/

To install it, cd into the eclipse directory (with the 'plugins' subdir), and unzip it. Then restart Eclipse.

Thursday, January 26, 2012

GalaxyNexus on Linux

Update: The much simpler solution is to change the USB settings on the GN to PTP, not MTP.

Apparently, newer Android devices don't just magically mount as USB drives on Linux (or at least, Ubuntu). Fortunately, someone else has figured it out already. They go through a couple extra steps for setting up a mount command alias, but in brief, you need to use the MTP (Media Transfer Protocol) tools.

sudo apt-get install mtp-tools mtpfs
mtp-detect | grep idVendor
mtp-detect | grep idProduct
# Create a udev rule (Galaxy Nexus is 04e8/685c):
# SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="685c", MODE="0666", GROUP="plugdev"
sudo vi /etc/udev/rules.d/51-android.rules
sudo /etc/init.d/udev restart
sudo mkdir /media/GalaxyNexus
sudo mtpfs -o allow_other /media/GalaxyNexus/
# To unmount
sudo umount /media/GalaxyNexus

Saturday, January 7, 2012

Android dev install

Installing an app you've developed on an actual Android device is documented pretty well, but I tripped over a missing step (c) for Linux:

sudo /etc/init.d/udev restart

I.e. Once you've added your settings to /etc/udev/rules.d/51-android.rules, you need to restart the udev service. Obvious in retrospect, I suppose.