Tuesday, June 30, 2009

Firefox 3.5 on Ubuntu 9.04

Well today the much anticipated speedy Firefox 3.5 arrived. Ubuntu probably won't push this one out as an update and I am not sure when Firefox's own auto-update would provide this upgrade, so if you're impatient as I, this is how to install it manually. Do read the whole thing through before deciding whether to do this, as there are some potential plugin issues involved!

Installation procedure
First you need to download and extract in an appropriate place. I'm extracting to /opt/firefox-3.5 such as to avoid collisions later when an official Ubuntu version is available:


casper@workstation/$ cd /opt/
casper@workstation/opt/$ sudo wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.5/linux-i686/en-US/firefox-3.5.tar.bz2
casper@workstation/opt/$ sudo tar -xjf firefox-3.5.tar.bz2
casper@workstation/opt/$ sudo mv firefox firefox-3.5
casper@workstation/opt/$ sudo rm firefox-3.5.tar.bz2 -f


Perhaps you notice that the download is a i686/32bit Linux release, this is because Mozilla do not presently build amd64/64bit versions. For this, we will have to wait for a version from our distribution. Now, lets check Ubuntu's browser settings:

casper@workstation:/opt$ sudo update-alternatives --display x-www-browser
x-www-browser - status is auto.
link currently points to /usr/bin/firefox-3.0
/usr/bin/firefox-3.0 - priority 40
Current `best' version is /usr/bin/firefox-3.0.


As you can see on my machine, only Firefox 3.0 is installed. We can add the newly downloaded version as an alternative and give it precedence on the system by issuing:

casper@workstation/opt/$ sudo update-alternatives --install /usr/bin/firefox-3.5 x-www-browser /opt/firefox-3.5/firefox 50


Also, we can make it default:

casper@workstation/opt/$ sudo update-alternatives --set x-www-browser /opt/firefox-3.5/firefox
Using '/opt/firefox-3.5/firefox' to provide 'x-www-browser'.


However, it's still not default on the path. To make it so, Ubuntu needs to update its symlink from /usr/bin/firefox to /opt/firefox-3.5/firefox:

casper@workstation/opt/$ sudo rm /usr/bin/firefox
casper@workstation/opt/$ sudo ln -s /opt/firefox-3.5/firefox /usr/bin/firefox



Voila. Issuing "firefox" on the command-line should now start Firefox 3.5 just as Ubuntu's shortcuts should now also point to the new version. On initial launch, Firefox 3.5 will check your extensions and plugins, as well as use your existing bookmarks etc. from your users home as usual on Linux.

Caveats
Note that if you previously had the amd64/64bit version of Firefox and plugins, your plugins will no longer work! It is of course very easy to just use 32bit plugins instead. In my case, I just lifted the two plugins I am interested in (libflashplayer.so and libjavaplugin.so) from another 32bit installation, but you can simply use Synaptic package manager to install 32bit plugins if you do not have these already.

If you don't wish to have multiple versions and perhaps have already uninstalled the old 64bit 3.0 version, then you may simply place the files in ~/.mozilla/plugins/. However, if you wish to have both versions on your system, you should keep the 64bit stuff around and instead add the 32bit plugins locally to your 32bit Firefox 3.5 installation in /opt/firefox-3.5/plugins/.

It's annoying to be back to 32bit for the time being but I do love the speed of this new version, and I'm sure you will too.


Update: Turns out there's an easier way, explained in this blog entry: http://talkingincircles.net/2009/07/01/firefox-3-5-in-ubuntu-9-04-64-bit/


Monday, June 29, 2009

Android Debug Bridge on Ubuntu 9.04

To perform general debugging and install alternative ROM's on the HTC Magic in Ubuntu 9.04, you will need a little more footwork than the documentation mentions.

First, I assume you have installed the SDK and added it to path so that you can perform ADB commands from everywhere. Then, you need to have USB debugging enabled on the phone, do this by going under Settings > Applications > Development and check the "USB Debugging" item.

Now, add a udev rule for your device:


gksudo gedit /etc/udev/rules.d/51.android.rules


Add the following to the file and save it:


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


Reload USB devices by issuing the command:

sudo /etc/init.d/udev reload


Unplug and plug the device. Check if you can see the device:

casper@workstation:~$ adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT95PKF00221 device


There, now you can browse your phone with the adb shell command and start diving into the rather interesting world of rooting and alternative ROM's found over on XDA-developers. My next move is to try the HTC Hero ROM on my Magic, which will give the phone the new multitouch Rosie/Sense interface.

Another cool thing is that if you start your Eclipse SDK and try to run an application, it will now deploy to the physical device rather than the emulator - pretty neat!

Friday, June 19, 2009

HTC Magic Android emulator skin

So I started playing with Android development, just received "Unlocking Android" and "Android Application Development" from Amazon. However before getting to do any real development, I got sidetracked in trying to create a skin for the Android Emulator that matches my new fancy HTC Magic. There actually exists one, but it's branded Vodafone, looks silvery and has the buttons all wrong so I decided this would be a good way to brush up on some Gimp skills. And here it is, I am no graphics artist so I am moderately pleased.



You may use images and skin as you please, under the creative commons license. You can download the skin by clicking here. To install, simply extract the files to {android_install_dir}/platforms/android-1.5/skins/HTCMagic/.

If you can not select the skin in Eclipse, you may have to edit the config.ini file of your virtual android device setting manually (under ~/.android/avd/), simply set the skin.path property to point to HTCMagic. You can also run the emulator manually by executing {android_install_dir}/tools/emulator and pass along the command line argument "-skin HTCMagic".

NOTE: I am aware that pressing the search button in the emulator has no effect. This appears to be because it is not implemented for the emulator at this time, since no other skin appears to have a working search button. I even read through the C and Python source code to see if I could find the proper key name, but with no success. Also note, the screen shown within the emulator in the above image, is not of the generic Android 1.5 (Cupcake) but rather a static image of HTC's Rosie/Sense UI which I find more sexy (can phone software look sexy?).