Thursday, May 24, 2012

Ideas for Improving Locale Management in Firefox

Mozilla Firefox Localization project spans 90+ languages across the planet. If you haven't used Firefox in a different language, try downloading a language pack and change Firefox user interface language by editing general.useragent.locale preference setting using about:config. Captian Caveman created an easy to use Quick Locale Switcher Firefox addon for this purpose.

In this post, I'll explore some ideas to improve the locale management experience inside Firefox. The idea adds unified search, installation and language switching capabilities to Firefox Language panel. You will find Firefox Language panel under Tools > Addons menu. Currently the language panel on Firefox Nightly build looks like this.


Firefox Languages panel

Firefox Language Panel Mockup

The mockup below describes searching, installing and switching locales workflow. This is similar to existing Firefox Add-ons workflow.


Firefox Language Switching Workflow

  • Enable Firefox Language Tab:Make Tools > Languages visible at all times. Currently Firefox hides this dialog when no language packs are installed.
  • Switch Firefox Default Language: Default Language Switch button "Default Language is 'English (US)', Do you want to change the language of Firefox?"
  • Search Languages: Modify search box to limit search to language packs on addons.mozilla.org.
  • Language Management: Provide Switch Locale toggle button next to each installed language pack.
  • Switch Language for this session only:Allow users to switch locale for this session only.
  • Get New Language: List download-able Locale packs on the main screen.

Please share your thoughts, suggestion and criticism using the comment form below.

If you are a Firefox hacker looking for something new to hack on, this is your lucky day! .

Sunday, May 20, 2012

Samsung Galaxy S2 Accessories For Presentations

In this post we'll explore some effective presentations techniques using Samsung Galaxy S2 accessories. Use the Droid@Screen (See this blog post) program to display the mobile phone screen on my computer during my presentations. This program works by taking a continues series of screenshots of the phone screen. There are some problems with this design, there is noticeable delay during application interaction and the video performance is not great on my Lenovo X120e Ubuntu computer.

You can not demonstrate audio and video capabilities of the mobile phone using such software. Planning to give a talk about using Firefox Mobile with Android 4 screen-reader and existing solutions doesn't work for me.

Samsung Galaxy S2 HDTV Adapter

This adapter allow you to plug in your phone directly into HDMI large displays and digital projectors. The mobile phone AC charger powers the adapter and no additional audio cable is needed. The Samsung HDMI adapters are available for Samsung Galaxy phones and tablet models.

This works really great if you are planning to setup large screen display in a exhibition booth. Connect the phone to large screen display with HDMI cable and play your video demo in a loop.


Samsung Galaxy S2 Power Pack

The Samsung Power Pack comes handy when phone runs out of battery in the middle of the presentation. It does extend the battery life of the phone during the presentation or an extending application testing session.

Few caveats using these accessories. The HDMI adapter will not work when the phone is attached to the power pack .

This power pack has some issue with power sensing, sometimes it starts and stops charging with annoying beeps every 10 seconds. And you need to press locking mechanism tight to get the phone to charge. Hope someone at Samsung fixes this problem.



Thursday, May 17, 2012

Unset Google Chrome as default browser on Ubuntu

Update: After further investigation, I found is the problem is in google-chrome application not in Chromium-browser. My Mistake!

Dietrich Ayala brought this problem to my attention. For some reason google-chrome browser constantly makes itself the default browser on Ubuntu 10.10 and later versions. This is annoying when you are testing Firefox Nightly Ubuntu builds. You can choose to remove the google-chrome, but that is not a solution.

First, I tried to reproduce this problem on multiple Ubuntu machines. To reproduce this problem, installed Firefox nightly using Firefox Nightly PPA. Remove any other browsers expect google-chrome.


It took very long time to find the solution to this problem. The chromium-browser package adds /usr/local/share/applications/mimeinfo.cache which supersedes the default system application settings. The solution is edit this file and make it read-only using chattr command.


$ sudo nano /usr/local/share/applications/mimeinfo.cache 
[MIME Cache]
application/earthviewer=google-earth.desktop;
application/keyhole=google-earth.desktop;
application/vnd.google-earth.kml+xml=google-earth.desktop;
application/vnd.google-earth.kmz=google-earth.desktop;
application/xhtml_xml=google-chrome.desktop;
text/html=google-chrome.desktop;
text/xml=google-chrome.desktop;
x-scheme-handler/ftp=google-chrome.desktop;
x-scheme-handler/http=google-chrome.desktop;
x-scheme-handler/https=google-chrome.desktop;

#Remove all the google-chrome entries, like this.
[MIME Cache]
application/earthviewer=google-earth.desktop;
application/keyhole=google-earth.desktop;
application/vnd.google-earth.kml+xml=google-earth.desktop;
application/vnd.google-earth.kmz=google-earth.desktop;

# Make it read-only even for super-user
sudo chattr +i /usr/local/share/applications/mimeinfo.cache





After making these changes. Open Firefox Nightly and make it the default browser. Now this system setting will remain unchanged.


Wednesday, May 16, 2012

Getting Started with Arduino in Hanoi

Spent the weekend learning basic electronics with Arudino open source prototyping platform. La 4uatrieme creative lab organized a two day Arduino workshop in Hanoi.

Designer and teacher Eoin Kinsella delivered a very interactive workshop. We learnt basic electronics, Arduino hardware and software environment by tinkering examples from the popular Getting Started with Arduino book. We spent the day building simple prototypes with sensors, switches and LED's on solderless breadboard and programed it using Arduino development environment.

The Arduino IDE on Linux is not well tested. During the workshop I found a minor bug in Arduino package in Ubuntu and fixed it right away.

Arky with Arduino LED circuit

The inexpensive Arudino hardware makes it easy to build interaction design and physical computing prototypes. With 3D printing services such as Shapeways you can now bring your ideas to life much faster than ever.

You can buy Arduino hardware in Vietnam from Soatec (www.sotatec.com) in Ho Chi Minh city.

Watch Arduino The Documentary (2010)

Monday, May 7, 2012

Arduino workshop in Hanoi (May 2012)

Arduino workshop poster


La 4uatrième: Arduino workshop 12th/13th May at la 4uatrieme//Hộ...: Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

 Read More


Wednesday, May 2, 2012

ClockworkMod (CWM) Recovery Backup and Restore Android Phone Firmware

In my last post, I introduced ClockworkMod (CWM) Recovery to backup your phone firmware. It is a good idea to copy these backup files to your computer for safe keeping.

You will find the ClockworkMod(CWM) Recovery firmware backups in this location on your phones internal memory.


/sdcard/clockworkmod/backup

You'll need Dobrica Pavlinušić's shell script to copy the ClockworkMod(CWM) Recovery backups to your computer. For some unknown path related issue the standard Unix 'cp' will not work. You won't be able to copy these backup files to your computer, however you can copy files from computer to phone without any problem.

#!/bin/sh -x

sdcard=/sdcard/clockworkmod/

adb shell ls -1 -d $sdcard/backup/* | sed "s!$sdcard/*!!" | tr -d '\r' > /tmp/backup.android
ls -1 -d backup/* > /tmp/backup.disk
diff -uw /tmp/backup.android /tmp/backup.disk | grep -- '^-backup' | sed 's/^-//' | \
xargs -i sh -xc "mkdir -p {} && adb pull $sdcard/{} {}"


To restore your phone firmware from your backups. Copy the ClockworkMod(CWM) Recovery files to the backup directory on the phone. Reboot the phone into recovery mode and use the Backup / Restore option to restore the firm.


Lately, I use this technique to deploy Boot2Gecko quickly onto compatible phones when the Boot2Gecko builds breaks. The new B2GBuilds.org project started nightly build of Boot2Gecko, you might want to check it out. Personally I would prefer the B2GBuilds.org project builds Cyanogenmod style otapackages instead. Support for this is coming soon, watch this space.

Popular Posts