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.

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/

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!

Saturday, June 20, 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?).

Wednesday, June 10, 2009

Android awesomeness

So I finally got an Android device, in the form of the second generation hardware from HTC known as the Magic, G2, Ion and Saphire. Since the original HTC Dream (G1) this phone received a major visual overhaul and now boosts a soft keyboard rather than a physical one making it a loss less clunky. And let me admit right away, I fell in love at once and have hardly put it down since. It is not my intention here to write any kind of throughough or balanced review, but merely to showcase Android and the applications to others contemplating getting one of these phones as well.

Initial impression
The phone looks and feels sturdy and quality, thankfully not branded like appears to be the case in the US. The 3.2" touch screen is glass just like the iPhone and the body is thick scratch-proof plastic. It has what amounts to 11 buttons (incl. a joypad) below the screen such as well as volume buttons on the side.
Having played with an iPhone a few times, my impression is that the Magic is very reminiscent of this groundbreaking device. I never actually invested in an iPhone as I don't care very much for the handcuffs Apple like to put on its customers - it's a somewhat different story with this phone. Also, to me the Magic feels better in the hand than an iPhone and definately slips easier down into a pocket. The battery is a 1340mAh Litium-Ion, bigger than the one in the G1 and enough to keep the phone powered for the day. It's important to note that it takes a few days for the battery to start charging correctly (to know its state) and it also takes a few days to learn how to use it such as not to drain the battery immediately but this is true of any smartphone.

While the hardware is nice, the real kicker is Google's Android operating system. The HTC Magic comes with version 1.5 (Cupcake) as well as some extra software installed into the ROM by my phone carrier that enables Microsoft Exchange integration etc.
Android can have applications installed from either the Android marked or by directly downloading the .apk file. There's already around 5.000 applications available, and with so many phones coming out and a rapidly growing community I see no reason why Android would stay shy of iPhone's 50.000 applications.

You can opt to lock the device by a custom gesture. This is a very handy feature that beats the traditional approach of having to enter a code.

The home screen with widgets and shortcuts on the desktop, live picture of the Eiffel tower as wallpaper.

On the left home screen I have primarily system tools.

On the right home screen I have frequently used applications.

The applications menu pops up when you drag the slider up. The screenshot does not convey this information, but I have around 75 application installed.

Long-pressing the home button reveals other recently run applications, unlike the iPhone this device has no trouble multitasking.

At the top of the screen, the status panel can be expanded as well. It's here notifications of any kind goes (email, SMS, instant message) and it works remarkable well.

In horizontal mode, the soft keyboard is a joy to use thanks to the dictionary suggestions.

In vertical mode, you really need to be precise and having small fingers is definitely a plus.

Google applications

The build in browser, based on KHTML like Safari and Crome. It does its job to perfection, best mobile browser experience I have tried.

The gmail integration is equally impressive. Simple and functional.

Of course, Google maps is there as well and works with the GPS.

It feels special to be out and about, with satellite pictures looking down at your position.

Even street view is integrated.

Skymap uses all the sensors of the phone to render an accurate representation of the sky complete with stars, planets etc. depending at where you point the phone.

It plays mp4 in very decent quality, here Romain Guy from the Android team.

YouTube is available via an integrated application that simply works.

The camera used as a barcode scanner, here a book is scanned.

Voila, we have looked up a book and can read reviews and find cheapest stores.

The Android marked is full of stuff, approximately 5.000 apps. but growing daily.

aTrackDog can track all installed applications and tell you when there are new versions and provide an easy way to update.

GPSstats is good to determine GPS coverage.

CellTower can be used to triangulate and display cell towers around your neighbourhood. Not really useful, but fun to see in action.

FlightStats was great on a recent trip, always providing me with up-to-date info about delays.

There are of course countless games, though they are less interesting to me personally.

No matter the IM protocol you rely on, you are sure to be connected.

Yes believe it or not, there's even a metal detector.

NetCounter is invaluable in monitoring data traffic. It may save you from receiving a nasty bill.

SpareParts provides great system info as well as tweaks.

Speedtest is good to debug and determine connection speeds.

TaskManager lets you monitor and kill applications.

MyTracks tracks you as you move around. Here is my walking route from the office to the local subway.

Some metrics from the walk.

Not quite detailed enough to show me mowing the lawn. lol

The beauty of an open platform. You can run Mono/C# stuff on it.

...as well as Python, BeanShell and Lua.

...and execute shell commands since it's a real Linux underneath.

There are only a few thorns on this white rose. It would be nice if HTC would use a standard 2.5mm mini jack instead of the propriatary mini-USB plug although this is easily fixed with a small adaptor. Also, the speakers are not the loudest I've heard from a phone so I would've preferred if they faced the same direction as the screen such as to improve the video experience.

As for Android and the software it's even harder to find flaws. The menu where you see each and every application is perhaps a bit overwhelming, although you quickly get used to it (sorted alphabetically). To remedy this, people sometimes install home application extensions such as to allow more than 3 screens. This is something Google can easily adjust through the Android updates coming.

The real beauty of this device is how open it is. For instance, Android itself has not been ported to other languages than english yet, but that has not stopped people from developing localized soft keyboards that matches a particular locale (in my case Danish). Even if the phone is 200-300$ cheaper than an iPhone, it has more potential and longevity that I think only Apple fanboys will miss the slightly better polish put on by Apple. I'm already looking forward to the next upgrade to Donut in a few months, as well as Eclair by the end of the year and I'm eager to start developing on it myself.