Category Archives: FxOS

Let’s become Mozillians!

Mozilla is special. No organization that I know of is so effective, open, or stubborn.

Stubburn because when the world embraced patent encumbered H.264 & MP3 Mozilla turned around and said: “Okay, then we’ll just make an encoding better in every dimension.”.

And that’s the story behind Daala & Opus.

Mozilla is not the organization we deserve. We deserve no better than MPEGLA, Apple, Microsoft, SAP, Oracle, or Intellectual Ventures.

Mozilla is the organization we need.

When someone says “The web is not ready” we need people who are working to make it ready. We are not going to see the real web on mobile until we stick it there. We need a stubborn organization which will keep fighting for our freedom even after we’ve all locked our bootloaders with someone else’s key.

We need an organization which goes into the mobile fight not looking to monopolize yet another app ecosystem. We need someone to unlock apps so when regular people ask “Does it have X app?” the answer is: “Yes, because it supports webapps“. Only then can operating systems compete as equals without user’s sacrifice.

So that rant should give an accurate portrait of my motivation for contributing. If it also describes you then please do consider contributing as well. In either case please enjoy my story.

Our journey starts mid-July 2013, I have just gotten back from Microsoft after another day of my internship. The weather is warm, the sun is shining, and it hasn’t rained in at least five minutes. First order of business is to select my project preferences for the coming semester’s UCOSP.

Our product selection is pretty broad: a programming language, conferencing webapp, code review webapp, and a few more webapps I do not remember. All fine projects but I only had eyes for two: RIght-to-left language support in Android Firefox, and Plugins for BB10 Cordova.

During my internship at Microsoft I came to the descision upon two things: I want to work for a smaller organization, and I’d go crazy if I could not talk about my work in the open. Those realizations and my preference for open source mobile operating systems close to the top of my list.

Back to the selection: As a way to make connections the Android Firefox project sounded perfect. Thus it was my first choice. BB10 took second but only for its merits as a project matching my exact interests.

As it happened, the UCOSP organizers saw through my ploy and assigned me to BB10. Yet despite the organizer’s clear attempts at thwarting me, they forgot one thing: our hackathon was being hosted at Mozilla!

In fact it appeared as if the Undergraduate Capstone Open Source Project organizers had not shared with Mozilla their plan of keeping me away from Mozilla. You see at the hackathon Greg Wilson gave everyone a tour of the new Toronto office: a modern and wonderful work environment on full display! Everyone was envious, including myself. Greg was even kind enough to give me his email!

With email in hand I went home to Calgary and worked. I worked so hard I mis-placed the email. That’s my story and I’m sticking to it!

With no email I took a long shot and asked the UCOSP organizers. They must have thought I was someone else because they give me Greg’s email without a fight. Now with email in hand for real I could email Greg asking how to apply.

And then I mis-placed the email again…

Just joking. Greg was encouraging and cc’d Mike Hoye, also of Mozilla, who gave fantastic general career advice plus good Mozilla specific advice. The advice is so good we should take a moment to read it together:

Don’t let anyone pressure you with what’s called an “exploding offer” – anyone who’s telling you that their offer is off the table after a certain date is just trying to fill chairs, and trying to scare you into accepting a job where you’ll be deeply undervalued. People who actually want to hire you _for you_ will, within reason, wait for you to make up your mind.

Finish UCOSP. Ship. Blog about shipping. Spin up a Mozilla build environment, go to http://www.whatcanidoformozilla.org/ and wander through it until you find a bug you want to fix, and then work your way through the process for fixing it. Ship that, and blog about that.

Then come and talk to us; let me know when you’re applying, and let the people you’ve collaborated with on that bug know you’re applying.

Unrelated to Mozilla, a colleague of mine ran this talk for Seneca last year: https://senema.senecac.on.ca/videos/1958/fsoss-2012-open-soucre-careers

It’s called “Open Source Careers”, typo in the URL aside, and you should watch it.

Thanks,

– mhoye

Just to make sure you understood please repeat after me: You should goto http://www.whatcanidoformozilla.org/ and find a cool project. Right now. I’ll wait for you. I’ll be right here when you get back.

Back?

I suspect you’re lying, instead just kept reading right? This is serious you should goto http://www.whatcanidoformozilla.org/, select a project and head over to BugsAhoy for a selection of mentored new contributor friendly bugs.

Promise me you’ll at least open the links and press 2 buttons. Just 2, not 3, only 2. Please? I’ll stay here and drink some tea.

IMG_20140110_213327

I promise you green tea which is the color green: is good green tea. The cookies are also pretty good.

Back for real? Okay I’ll trust you.

Now I should caution that the pain I encountered with the development environment I encountered is not something an app developer will encounter. With the disclaimer complete I must admit I’ve bricked one (1) phone. You see developing apps for FxOS is fast and easy but compiling an entire operating system is a bit more complex.

Before I could do anything I needed a phone so I ordered the recommended and cheap ZTE Open from ebay. While waiting for the phone’s arrival I experimented with FxOS’s QEMU based virtual machine, which I did not succeed at.

When I did receive the phone I set out at once to blog about it. Looking back I’m a bit ashamed, almost all of the issues I identified had already been reported. I should have searched for reports ahead of time so I could point out how things had been fixed. Instead at least one reader got the impression I hated FxOS.

On that note, my attempts at compiling for the ZTE Open have bricked it. The issue is well reported on the mailing list but I’m happy to report that ZTE is working on it.

Instead I’ve been developing on an old Nexus S. The odd thing is my build images have been using ZTE Open’s system backup. By no rights should my Nexus S be anything but bricked. Since the environment is working, I’ve avoided “fixing” this oversight.

With a working build environment I did what you just did: found a cool mentored bug from BugsAhoy. Right at the top of BugsAhoy’s list for firefox os mentored bugs was Bug #939372. This bug stood out as being perfect: low-level, C++, and self-contained.

The exact issue with bug #939372 was that Firefox OS logged all kernel out-of-memory messages via a shell script running as root. Dave Hylands’s suggested solution was to write a new program which could open the kernel log as root but then drop all root permissions unrelated to reading the kernel log.

So I wrote a first attempt at such a program. Perhaps the biggest pain was the permissions dropping. Being a stand-alone program I wanted to avoid bringing in a library dependency. This meant writing against linux’s system call interface. You might have noticed that this is Very Bad Thing™ to do. In this specific case, it was acceptable because the program was to go into FxOS’s hardware abstraction layer. Still, for any kids reading at home please do not attempt this, double so for Windows™®©☘ specific code.

At this point I started hanging out on the Mozilla IRC channels. Now I’m going to show you some links but please do not open them. Please, this is serious and not reverse physiology. –Begin Dangerous Links– Mozilla funny quote database and Mozilla memes. –End Dangerous Links– How dangerous you might wonder? I just wasted 10 minutes reading jokes I’ve read before!

The real IRC conversations are less exciting than the highlights. You may see more Qdot… flavour. For the most part, you’ll overhear people debugging and assisting others. Altogether Mozilla appears to be use IRC to be productive and less about in-jokes.

A bit prior to joining IRC, I did subscribe to the Mozilla mailing lists. These lists are pretty easy to follow and much lower flow than the Linux Kernel Mailing list. The two lists I’ve subscribed to, b2g & gaia, give a good feel for FxOS’s direction. I’ve also noticed that Mozillians are nice to a fault and will respond at face value to even “worthless” email. I’m not sure it’s even possible to write something inane enough to get called out upon. That’s an impressive community wide commitment to being a friendly community!

Back to bug #939372 Dave Hylands has now reviewed my attempt at the stand-alone logger. Along with my patch I asked a few questions. After some discussion, Dave brought in Michael Wu for an opinion. Michael suggested we move logging into the main b2g process. Since this would save me the permissions dropping mess, I had few protests.

Here’s where Dave’s mentoring saved the day: he pointed me to the exact line where to add the logging. It may sound like a small help but FxOS is huge and without his guidance I would have been stuck.

Then Dave gave me eight high quality code reviews, one after the other. Each time he identified real issues with my code. I got the impression he cared about the patch just as much as I did. He even found an issue with the Unagi’s kernel logging which I could not have found: the unagi’s kernel had been patched to format message timestamps in human readable time and not seconds since boot.

At the end of this process I can say with a smile and confidence that I’ve never before participated in a more thorough code review. It is nice to have another programmer dedicate their time to helping you. Dave went out of his way to make Firefox less intimidating and I do not want to imagine how lost I would have been without his help.

This entire process occurred out in the open, you can read it all here on the bug report itself: https://bugzilla.mozilla.org/show_bug.cgi?id=939372 In fact in the beginning I had emailed Dave in private. In the spirit of being open Dave encouraged me to bring the full conversation to the bug report.

It’s small things like encouraging public communication, which make me think open by default is not just a saying at Mozilla. The entire organization lives open by default, you can even attend one of the weekly team meetings. Even if you do not have anything to say you might enjoy just listening. I once attended the B2G meeting and was greeted with an in-depth and geeky discussion of quadcopter kits and microcontrollers.

Now I hope this story has sparked some envy in you. Contributing to FxOS is fun and less work than you’re expecting. Remember that website I harassed you into visiting: http://www.whatcanidoformozilla.org/ ? This would be a perfect time to find yourself an approachable mentored bug and take your first step to becoming a Mozillian.

If nothing else it is now safe to checkout the meme and quotes databases.

 

Just bought two cheap Androids for B2G surgery

I’ve been mulling the idea of buying a cheap disposable Android with which to port B2G onto. These cheap Androids can be quite cheap. One I bought was $56, the other $77. Shipping was for both.

My selection algorithm was:

  1. Order by price
  2. Filter to Android 4 or greater
  3. Check out any orange (firefox) coloured phones
  4. Find two distinct phones with the same System-on-Chip (SoC)

My final selection was the “M1 Smartphone” by “htm” , and the “Tengda H10” and by “htm”.

M1 by "htm"

M1 by “htm”

 

Tengda M10 by "htm"

Tengda M10 by “htm”

 

My last experience with cheap Chinese origin Androids was one of the first generation Android tablets. The device was a clone of the iPad and featured a resistive touch screen. Calling it slow would have been a complement. From that baseline these devices have a good chance to impress.

These devices might look quite different but they are in fact almost the exact same. The variety in the cheap android market place is misleading. Under the hood most devices are quite similar. In our case these two phones have the same SoC and camera. By having two similar devices my hope is to create a B2G configuration which will work for all MTK6572W devices. The two devices are from the same manufacturer but do differ in RAM, flash, and baseband. This should give a workable sample of similar devices.

Or maybe they’ll become paperweights!

Intro to Mozilla IRC Lingo

If you are new to Mozilla’s IRC channels, as I am, then you might have noticed some new and unknown words. All companies and communities have internal lingo built up over many years. Mozilla is different from a typical company because regular internal communication is done in the open. This means we get to hear said lingo used among employees who all know the terms by heart.

It can be intimidating coming to any community with such history and culture as Mozilla. This feeling is perfectly normal and will dissipate in time. To help the process let us explore some of the common terms unique to Mozilla. Thus you’ll know the terms the next time another Mozillian uses one.

R+

Mozilla has a healthy culture of code reviews. Real, concrete, effective code reviews mean approval is not trivial. An r+ means completing a code review and approving the commit. Some aspects of the patch may need changing but for the most part the patch is clear for commit. The wiki has more details on r+’s and their exact meaning if you want to get technical: https://wiki.mozilla.org/Firefox/Code_Review#What_does_r.2B_mean.3F

R-

The opposite of an r+ is the r-. Given when a patch is rejected, an r- does not mean the change cannot be fixed. Since r- can come across discouraging I suspect reviewers only use the term when talking to long term contributors.

CLOBBER

In all situations I’ve seen where CLOBBER gets mentioned it has been out of frustration. To clobber a tree causes a massive slowdown and annoys other developers but I do not understand the exact cause. The wiki provides some details but I’m not familiar with the build system: https://wiki.mozilla.org/Clobbering_the_Tree

ping

To get someone’s attention on IRC it is typical to mention their name in a message. This triggers highlighting of your message and triggers a bing sound on some IRC clients. If someone is on IRC but not active it is common for mozzilians to “ping” them. Such a ping takes the form, “<username>: ping”. For example when pinging me you would say “danieru: ping”. You’ll notice that this typical usage excludes any details about why the person is getting pinged. Instead it has been suggested that a ping should also contain a sentence mentioning the ping’s purpose. So going back to our example you might want to say “danieru: ping, I need help compiling fxos. I’m getting linking errors with example()”.

pong

In response to a ping the person pinged will often say “pong”. This means you may see “ping, pong” if both users are online at the same time. For any native English speakers reading the humour comes from the usage of “ping” which is a network tool used to check connectivity as a way to check for the attention of other Mozillians. Then in response “pong” interprets the ping as the “ping” in ping-pong, a sport also known as table tennis. Sorry if this ruins the humour.

++

In programming languages inspired by C the operator ++ is  the pre or post incrementor. It is used like thus: “var++”. This operator will make the incremented variable equal to the original value plus one. Thus on Mozilla IRC, ++ is another way of saying “+1”. In turn “+1” is an expression meaning “I like this” or “This is true”. So if someone says ++ it means they are agreeing with something said earlier.

And that completes my knowledge of Mozilla specific terminology. If you know any other terms please mention them or ping me.

land

Commit a patch to the inbound branch or repository after the patch has been reviewed with a R+. For Mozilla Central this would be mozilla-inbound or for Gaia the gaia/master branch.

Uplift

Merge or promote a patch from the inbound repository to the stable branch. For Mozilla Central this would be Mozilla Central or for Gaia this would be a tagged version branch such as 1.2.

Sec-Critical

When security bugs which cover normal browsing get found they are marked sec-critial. These bugs cannot be viewed by the general public until they have been fixed. Once a fixed version of our software has been shipped the sec-critical bug is made public. For example  see Bug #785967

Chemspill

When a security bug is found it may force our hand and require an early general release of our software. This early release is known as a chemspill.

Clownshoes

Bugs vary in scope and size yet in general a bug will only have one developer writing code to fix it. This can create a situation where the bug is larger than the person. Or as the analogy goes: the person is wearing oversized clownshoes.

TODO: No other terms I know of. Can you suggest any?

Unboxing the Firefox OS ZTE Open, + setup

My Firefox phone arrived today! The ZTE Open is an interesting device. ZTE is selling it on ebay for ~$80. By no means is it a high end device. In theory I like the idea that developers are not running devices 7 times more powerful than their users. Targeting the emerging market only pushes down the average device’s horsepower. As a bonus this dev phone is cheap and does not require subsidization or give aways like the earlier androids or blackberry dev phones. The price itself puts it in impulse buy territory.

First I must admit to being struct by the box’s slipcover. The cardboard look is utilitarian and sparse.
IMG_20131021_161027

The box under the slipcover is more typical for a smartphone. I can imagine seeing this box on a retail shelf.IMG_20131021_161127 IMG_20131021_161226

Included with the phone is a micro usb cable, headphones, and a usb charger. Without listening to them I suspect the headphones are not going to sound good.  The battery is pre-inserted in the phone.IMG_20131021_161349 IMG_20131021_161514

We must insert the battery which requires finding the latch in the the lower right corner. I’ve photographed the location since it was harder to find than expected. You will not feel the latch during normal usage.IMG_20131021_161615

Upper left is the microSD card slot, the right is the fullsized sim slot. IMG_20131021_161702

First bootup splash screen. IMG_20131021_162055

Second bootup splash screen. IMG_20131021_162059

Once booted we enter the setup process. There are things I think should be changed. Please do not that this as criticism but instead as justifications for my suggestions which will find their way into bug reports.IMG_20131021_162130 IMG_20131021_162154 IMG_20131021_162333

Once we’ve entered the wifi password and joined the network we’re sent back to the network select screen as shown below. This was not what I expected. I thought we’d go on to the contacts screen since we’ve done everything we can do with the wifi. IMG_20131021_162405 IMG_20131021_162406

This screen is what I do not understand. We already have network access, and we’ve had minutes to initiate the GPS. I should not have to tell the phone anything of what it is asking. Notice how the time has defaulted to the epoch, unix timestamp zero. Now assuming we need this screen only as a fallback I wish we were not expected to guess what those buttons will change. It should tell me we are looking at:

  1. Region
  2. Nearest City in timezone
  3. Date
  4. Time

I bring this up because I got confused. I thought #2 meant province / state. I do not know what or where “Pago Pago” is. I thought #3 is date format. Similar to how golang defines date formatting. Instead it was the date selector.

IMG_20131021_162407

Considering the emerging market nature of FxOS’s target market I think this risks confusion. I know that when selecting a timezone I must pick Edmonton. I know this only from installing linux several times. We cannot expect regular people to know they must select a city, which they may not live in, which must be close, but which must not be in the next timezone. To make matters worse the list is ordered alphabetically. Without knowing the exact city to select we must search through a list containing every city on our continent.

Good would be to order by location. Better would be to have them select their location on a world map. Best would would be to use our GPS if we have a signal.IMG_20131021_162520

Now onto the time selector widget. This is what said time selector looks like right after we hit “change”. Notice how it knows the current date. Remember how the screen prior defaulted to timestamp zero. The phone already knows the current time!

Better would be to preset the setup screen’s time to whatever time this time selector widget thinks it is. Best would be to send off an NTP packet and get the real time over the network. Remember, we already setup the wifi connection.IMG_20131021_162617

This title is too long.  I had to change my app’s title to fit the app screen, this screen needs the same treatment.IMG_20131021_162850

I wish something in bigger letters told me this is a newsletter signup screen. Instead I thought it was a registration screen. IMG_20131021_162900

The following tutorial is good and does the job. I’m sure they would prefer a tutorial which used the real homescreen instead of the abstract images. I understand that feature is extra work on a level beyond the other suggestions. I just hope it is on someone’s todo list. IMG_20131021_162920 IMG_20131021_162930

Note how it asks us to find new apps to the homescreen’s left, we will have a problem with this later. IMG_20131021_162938 IMG_20131021_162947

Also note how it asks us to swipe down. IMG_20131021_162957 IMG_20131021_163009 IMG_20131021_163023

Keeping in mind the instructions we saw earlier I wanted to install the app i made a few days ago. This screen is supposed to be where one finds new apps. Yet these search results do not look like the “IP Address” apps I saw in the Firefox Market. Instead these look like website bookmarks.IMG_20131021_163340

Rather we must go to the homescreen’s right where we find the Firefox appstore. And it is here we find my app. IMG_20131021_163523 IMG_20131021_163621 IMG_20131021_163640 IMG_20131021_163650 IMG_20131021_163737

As we noted earlier one should be able to bring down the notification screen by swiping down from the top. Instead we must press, hold, then pull down. Swiping down without holding is interpreted as swiping left or right.

IMG_20131021_163812

Now just for interests’ sake let us analyse the ZTE Open’s box in relation to the other dev phones I have. The Nexus 4 aims to look premium. The box is trying to convey that a $300 phone can be no less premium than the $600 competitors. The Blackberry 10 box aims to feel exclusive through the mission statement on the box. All the Blackberry dev phones are given as gifts to developers. They want you to feel honoured and inspired to develop an application.

The exact mission statement is:

Exclusive for the Blackberry Developer
Community. Not a production modal.
Evaluation unit -- not for resale.

Millions of possibilities..

By my guess the ZTE Open aims to look grassroots or atleast non-intimidating. The Blackberry mission statement is the opposite. Blackberry wants to look established and confident. ZTE Open wants to look new and promising.

IMG_20131021_172233

To be honest I think the box achieves the goal. I do not expect FxOS to be complete. I expect it to have room for improvement and to be welcoming of my contributions. That is what FxOS needs right now, the luxury boxes can come later.

FxOS app development is super easy!

Over the years I’ve setup several app development environments:

  1. Meamo
  2. Android
  3. Ubuntu Touch
  4. Blackberry

None of those compare to how pleasant Firefox OS’s dev environment is. This morning in viruses class I installed the Firefox OS simulator. Unlike the above platforms the simulator is not a full weight virtualized operating system. It is nothing more than a firefox addon!

The other platforms would take a full day or more to setup their virtual machine and the compile tool chain. Instead I was making real progress on my first FxOS app before my morning’s first class was over!

Now 12 hours after starting my app is live on the Firefox Marketplace!

The app itself is here: https://marketplace.firefox.com/app/my-ip-is/

The source is in this git repo: https://github.com/daniel-dressler/whatismyipaddress

Next I plan to port the html5 WordPress Update Assistant I wrote last year. The entire process is pure fun and I am surprised at how easy FxOS has made app creation.

myip_logo_128

The FxOS app icon style appears to be circles. This is in contrast to iOS’s rounded squares, and Android’s objects.

screenshot_1

I used Firefox’s “building blocks” which provide FxOS look and feel through css sheets. Other apps in the marketplace use bootstrap or jQuery Mobile. The high quality apps use the building blocks plus heavy themeing.