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

Saturday, March 3, 2012

Barcamp Saigon (Winter) 2011

Attending Barcamp Saigon gives you a glimpse of the new Vietnam. As you travel from the Ho Chi Minh city center towards the RMIT International University, the overloaded motor bikes and street hawkers in large conical hats are soon replaced by swank cars and posh apartment buildings. The Barcamp Saigon registration desk was already bustling with people when I arrived at RMIT campus. Everywhere you look, you will see fresh young faces. You can see the aspiration of the country in the faces.

Traveled from my home in Hanoi to attend Barcamp Saigon on December 11, 2011. Walking through the main hall of the Barcamp Camp, you'll see students, IT professionals, expats working in technology startups. The Barcamp Saigon itself is organized by a group of expats and local volunteers.

There are Job boards advertising new positions in startups, online book seller Tiki.vn's booth, RMIT education booth and free coffee from a new cafe outlet in the main hall. The Kindle Fire on display at Tiki.vn's booth was certainly drawing quite a lot of interest. Judging by the Barcamp talks, there seems to be a marked interest in the technology, gaming and entrepreneurship.

Event Registration Desk

Main Hall

Barcampers at the opening Session

Voting for the Talks

Electronic Arts (EA) talk

Technology Entrepreneurship, Startups, Angel Investors in Vietnam

Internet Governance in Vietnam

Skunkworks.vn Gamification talk

Javascript Libraries Talk

The Javascript talk in Vietnamese attracted a large crowd. Talking to people at the barcamp made me realize the need for Mozilla developer engagement in the region. My conversation with the Ubuntu community members, Teachers, Students expressed their interest for such engagement. Later on I meetup with Lilly Nguyen from UCLA to learn about her experiences with FLOSS communities in Vietnam.

Mozilla Engagement at Barcamp Saigon

We managed to schedule two Mozilla talks at Barcamp Saigon. Participants learnt about the story behind Mozilla project and how to contribute to Mozilla software. Vu Hung gave a talk about Mozilla Vietnamese localization project and I talked about testing the latest Firefox Mobile for Android.

The Mozilla Story

Mozilla Vietnamese Localization

Vu Hung contributes Vietnamese translations to Mozilla Firefox and other FLOSS projects such as LibreOffice. In this Vietnamese language talk he explained various aspects of Mozilla Localization; the software and the challenges of localization. Thanks to volunteer efforts Mozilla Firefox is available in Vietnamese. The talk encouraged people to join and help translate Vietnamese localization of Mozilla software.

Vu Hung Localization talk

Testing Mozilla Firefox Mobile

The talk introduced the Mozilla Mobile Test Drivers program. The program aims to attract early adopters to try out Firefox mobile nightly and report problems. The response was positive, there were very few Android devices capable of running Mobile Firefox around. However I except this to change very soon here in Vietnam.

We had good number of people attend the talk. Ubuntu Vietnam community was also present in the room. At the end of the session I invited Ubuntu Vietnam community to briefly present their work to the audience.

Ubuntu-VN Community Talk

Developing IT Community in Saigon

Unlike other barcamp talks, this interactive session discussed various ideas for developing an active IT community in Saigon. The participants decided to start a new community called 'Creative Saigon' to further this goal. I was really happy that my suggestion 'Creative Saigon' got the most votes. Guess the offer of 'Free Beer' also helped.

Towards the end of the discussion, I put forth a challenge to be pro-active about developing the IT community by starting right now. Would anyone join me for the first Beercamp Saigon next day?. As expected no one showed up at the Beercamp Saigon expect for my friends from Hanoi Lilly and Mieh. As of writing this post, Beercamp Saigon is a regular event in Ho Chi Minh City.

Wrapping Up The Barcamp

The highlight of the evening was not announcing results for the best barcamp talk, but blowing up the digital projectors light bulb in the main auditorium. The MC decided to play the Korean Girl Band 'Bring the boy out' video while waiting for the results. That was one *hot* video indeed.

Taking the feedback from the barcampers was important part of the evening. We heard people share the best and worst thing about the Barcamp Saigon. The Barcamps regular fixture Preetam Rai encouraged everyone to participate in the upcoming Barcamps in Cambodia. Someone asked 'What about Barcamp Hanoi?' Well, we are going to have one in the next few months.

Let us hear some feedback

Barcamp's changed my life

I didn't get my Barcamp Saigon T-shirt

Preetam Rai at Barcamp Saigon

Come join us at Barcamps in Cambodia

Popular Posts