Monday, March 26, 2012

Building Boot2Gecko(B2G) on Ubuntu

Update: This documentation is out-of-date: Please read developer.mozilla.org/en-US/Firefox_OS/Building for latest information

You heard about Mozilla Boot2Gecko(B2G) mobile operating system. Boot2Gecko's Gaia user interface is developed entirely using HTML, CSS and Javascript web technologies. If you are an experienced web developer you can contribute to Gaia UI and develop new Boot2Gecko applications with ease. In this post I'll explain how to setup the Boot2Gecko (B2G) development environment on your personal computer.


You can run Boot2Gecko(B2G) inside an emulator or inside a Firefox web browser. Using Boot2Gecko(B2G) with QEMU emulator is very resource intensive, so we will focus on the later in this post. I'll assume you are comfortable with Mozilla build environment. So, get that pot of coffee brewing and prepare for a long night of hacking.


Building Boot2Gecko(B2G) Firefox App


Before you start, let us make sure that you have all the prerequisites for building Firefox on your computer. Please have a look at the build prerequisites for your Linux, Window and OSX operating system.




# Let get the source code 
# Download mozilla-central repository 

$ hg clone http://hg.mozilla.org/mozilla-central mozilla-central

# Download the Gaia source code 

$ git clone https://github.com/mozilla-b2g/gaia gaia

# Change directory and create our profile 

$ cd gaia 

$ make profile 


# Change directory into your mozilla-central directory

$ cd mozilla-central


# Create a .mozconfig file inside your mozilla-central directory: 

$ nano .mozconfig 
mk_add_options MOZ_OBJDIR=../b2g-build
mk_add_options MOZ_MAKE_FLAGS="-j9 -s"
ac_add_options --enable-application=b2g
ac_add_options --disable-libjpeg-turbo
ac_add_options --enable-b2g-ril
ac_add_options --with-ccache=/usr/bin/ccache 

# Build the Firefox B2G app and wait for the build to finish 

$ make -f client.mk build 


# Create a simple b2g bash script to launch B2G app; change paths you suit your environment
# Note: Have to use to -safe-mode option due to bug on my Ubuntu box 
 
#!/bin/sh 
export B2G_HOMESCREEN=http://homescreen.gaiamobile.org/
/home/arky/src/b2g-build/dist/bin/b2g -profile /home/arky/src/gaia/profile




If everything goes well. You should have boot2gecko running inside a firefox now.


Boot2Gecko running inside firefox on Ubuntu


Customizing Firefox B2G App

For better Boot2Gecko (B2G) experience, we will customize Firefox features offline cache and touch events using a custom Firefox profile.



Create a Custom Firefox Profile


You can use dist/bin/b2g -ProfileManager option to launch Firefox Profile Manager. Create a new profile called 'b2g'. Now we can add customizations to this new profile.


On Linux computers, the profile is created under ~/.mozilla/b2g/ directory. You can find the information about location of firefox profiles for your operating system here.



You launch B2G with your new custom profile using the '-P' option. Modify your B2G bash script and add the custom profile option. dist/bin/b2g -P b2g


Disable offline cache


Create a user.js file inside your custom 'b2g' firefox profile directory. Add the following line to disable offline cache.

user_pref('browser.cache.offline.enable', false);


Enabling Touch events


Add the following line in your user.js file inside your custom 'b2g' Firefox profile directory to enable touch events.

 user_pref('dom.w3c_touch_events.enabled', true);



That's it. You now have a Boot2Gecko(B2G) running inside Firefox on your computer. Happy Hacking!

Thursday, March 15, 2012

It's Finally Here! Beercamp Hanoi

Beercamp, the tech-cultural revolution that has spread across Asia is finally coming to Hanoi.


It's like Barcamp-but with more beer. And every month too. We will hold the inaugural Beercamp event this Saturday, March 17th 2012, 5:30pm at The Windmill 31 Đặng Trần Côn, Đống Đa, Hanoi.


What is a Beercamp?


Beercamp is about people and connections. There is no topic, no agenda: the focus is on meeting up and finding common interests. It’s an reason for geeks to get out and socialize. It’s a chilled-out atmosphere where we can talk shop and talk business, and a way to stay in touch with the community and what’s happening.



Seriously: it's a great way to chill out, talk about what matters and meet other geeks in a fun, beery environment.


Beercamp Hanoi Event Details

  • Date: Saturday, March 17, 2012
  • Time: 5:30 PM till 7:30 PM
  • Cost: Free Event (Buy your own drink, better get me to buy you one :)
  • Venue: The Windmill, 31 Đặng Trần Côn, Đống Đa, Hanoi Phone: +84 4 38233774
  • Google Map: http://g.co/maps/6nn7b
  • Directions: Heading West on Cát Linh turn left immediately after Tôn Đức Thắng
  • About the Venue: Czech-style brewery restaurant built around a large courtyard. The home brew beer costs around 28,000VND. You also have food and non-alcoholic beverages available on the menu. We'll be sitting outside so dress warmly.
  • Contact: Arky (@playingwithsid)
  • Email: HITMANARKY (AT) GMAIL (DOT) COM


View Larger Map





Watch this space for updates and future beercamp announcements.

Wednesday, March 14, 2012

How to Fix Samsung Kies connection problem

Update (Aug 17,2013): Testing Samsung Kies on MS Windows 7. The Samsung Kies connects after a while or only intermittently. Please see the comments below for possible solutions.

Samsung mobile phone users are familiar with this error. Kies is a personal computer sync software that enables you manage your Samsung phone, similar to iTunes software for Apple iPhones. Samsung Kies software refuses to connect your device and gives this cryptic message.

Reconnect the device in Samsung Kies (PC Studio) mode. Current connection Mode not supported by Kies

Spent an hour raking my brains, then the obvious solution presented itself. Turn off USB Debugging Mode. You will find this setting under Settings > Applications > Development.

Visual Guide to Android USB Development Settings

Samsung Kies software uses MTP (Media Transfer Protocol) mode to talk to your Android device. Enabling USB debugging setting changes your android device to use USB transfer mode.

Friday, March 9, 2012

Samsung Galaxy S2 GT-i9100G: Review, Firmware, Software Update, Rooting

Mozilla Mobile Test Drivers program lent me a Samsung Galaxy SII mobile phone to test the nightly builds of Firefox Mobile. This Android 2.3.6 (Gingerbread) phone runs off a powerful dual core A9 1.2 GHz processor with a good responsive capacitive touch screen. The device is impressive and attracts a lot of attention everywhere.


Samsung Galaxy S2 Android 4.0 (ICS) Update


On March 10, 2012 Samsung will release an firmware update for Android 4.0 code named Ice Cream Sandwich. You will find the upgrade information here on Samsung website.


Android 4.0 promises to offer better accessibility and internationalisation support. You can navigate the android phone built-in screen reader using touch gestures. There is much better rendering support for Asian languages and additional Unicode fonts are bundled with the release.


Cyanogenmod Firmware for Samsung Galaxy S2 (GT-I9100G)


The Cyanogenmod has been boon for mobile phone technophiles. The project provides customised firmware for wide variety of phones. Unfortunately Samsung Galaxy S2 (GT-i9100G) is not well support by Cyanogenmod project. Why? Samsung had changed the hardware specification of this model and none of Cyanogenmod developers have this phone model to work on.


Last week, Yang and I spent an afternoon looking for compatible firmwares to root Samsung Galaxy S2 (GT-i9100G) . After few failed attempts we found that MyGKernelV1.1.1_CWM5.tar version managed to give us root access to the phone.


Installing Boot2Gecko on Samsung Galaxy S2 (GT-I9100G)


You have heard of Mozilla Boot2Gecko. The Mozilla entry into smart phone market was unveiled at Mobile World Congress last week. Build with HTML5, CSS and Javascript, it allows web developers an open phone stack for their applications.


The Mobile World Congress Boot2Gecko videos shows a Samsung Galaxy S2 running Boot2Gecko. You should take note that this Samsung Galaxy S II model is GT-I9100. The Boot2Gecko developers use Samsung Galaxy S2 as their development platform.



Since Cyanogenmod scripts are used for Boot2gecko installation. You won't be able to install it on Samsung Galaxy S2 (GT-I9100G) without lot of hacking. Recently there has been a lot of talk about people dying to install Book2Gecko on Samsung Galaxy S2. Caveat Emptor.


Tuesday, March 6, 2012

How to display your Android screen on your desktop

A good screen capture tool is essential for Android developers. It is invaluable while making presentations as I recently discovered during my talk about Firefox Mobile Testing.

Thanks to flyingclimber for introducing me to Droid@Screen. This tool enables you to display your android screen on your desktop in portrait/landscape mode and does image scaling too. Making screen shots and videos of your android device is also supported. If the video performance is not so good, try changing the frame-rate settings.

To use Droid@Screen, you need Java and Android SDK installed on your computer. Download this droidAtScreen-0.5.1.jar file from here or from this mirror and run it by typing this command in your terminal. Make sure you have enabled 'USB Debugging' on your Android device.


# Download the program 
$ wget http://blog.ribomation.com/download/http://blog.ribomation.com/wp-content/files/droidAtScreen-1.0.1.jar

# Launch Droid@Screen from command-line
$ java -jar droidAtScreen-0.5.1.jar

The software prompts you for the location of your Android SDK adb.

Connect your phone and select the device name from the Droid@Screen menu. And you are done.

Video Tutorial of Droid@Screen

Monday, March 5, 2012

Barcamp Hanoi 2012 is Here!

A year ago I never heard of barcamps. My ideal conference meant sitting among spiderweb of power cables and writing strings of computer code with bunch of geeks. Things changed when I moved to Vietnam. In this part of world the best conferences are barcamps. So I started attended Barcamps in Myanmar, Thailand, Malaysia, Singapore, Cambodia and in Vietnam.

At these Barcamp friends would ask me, when we will have a barcamp in Hanoi. The last barcamp in Hanoi was organized in 2009. Things soon feel into place when I met Christoph Kruppa at Barcamp Saigon (Winter) 2011. He connected me to few people in Hanoi who also wanted to another barcamp in Hanoi.

And today I am happy to tell all friends, Barcamp Hanoi is here. Don't forget to come and attend it.

Barcamp Hanoi 2012 Event Details

What is a barcamp ?

BarCamp is a user-generated event — open, participatory workshop-events, whose content is provided by participants — focusing on technology as well as teaching and learning.

Sunday, March 4, 2012

Firefox Developer Tools at FOSS@HUS

FOSS@HUS is annual technology festival organized by the Hanoi University of Sciences, Hanoi. This event encourages the students of the university to learn and contribute to the Free and Open Source software. This year, the event featured talks on Fedora community, LibreOffice, Open Street Map (OSM) and Open VoIP solutions.

Mozilla Firefox Developer Tools

The Mozilla Firefox Developer tools talk introduced the features that help accelerate web development. The Mozilla Firefox design is driven by user needs. The new developers tools are good example of such focus. The talk encouraged audience to download the Nightly, Aurora builds of Mozilla Firefox and try out Web Inspector, Web Console, Scratchpad Javascript editor and Style inspector. Written in Javascript these web developers tools are great for budding Firefox hackers.

Yang helped translate the talk in Vietnamese

The FOSS@HUS organisers and speakers

Popular Posts