Fennec and Native Android UIs
Bringing up a User Interface (UI) as fast as possible is a very important goal and benchmark of any application. People don’t want to wait for their applications to load. Most applications on Android show a UI in under 300 milliseconds (ms). Fennec doesn’t hit that goal and is a major concern for us.
The problem is that Gecko (our rendering engine) isn’t loaded when Fennec starts. We need to load Gecko into memory, start Gecko, then wait while it renders our UI from XUL. This is a lot of waiting around for us to show a relatively simple UI.

Not a super fast phone.
At the Mozilla AllHands, Andreas Gal, Chris Jones, and Patrick Walton built a simple browser using a Android native front end instead of XUL. They showed a simple native UI around Gecko could be started in under 300 milliseconds. The idea is that the user immediately sees a familiar browser UI and while they are typing a uri or interacting with the UI, we load Gecko in the background. Their demo, although not complete, was dramatic and did not show any startup problems.
Using a native UI does imply certain things. Clearly add-ons, specifically XUL overlays, will not work as-is. Mozilla’s Embedding API has been kinda-sorta deprecated and we may need to use those APIs to make a better app. There may be other issues that come up.
To figure out these issues, we are starting a team to build out a more full featured demo. The work can be followed on github (git@github.com:snorp/mozilla-central.git branch faster). If you are interested, please drop me an email, or send me a pull request.
Lastly, and most importantly, we will continue the existing XUL-based Fennec project and future Firefox on Mobile will still be based on the XUL front-end. The team will continue focusing on startup performance, memory usage, bugs fixes, and features. The Native Android UI project is an investigation at this point.
Trackbacks & Pingbacks
- Firefox 8 beta brings Twitter search, tab controls | Christian Media Cross
- Firefox 8 beta brings Twitter search, tab controls | Brian's Blog Site
- Firefox 8 beta brings Twitter search, tab controls » 99dzh
- eXactBot Hosting Solutions » Firefox 8 beta brings Twitter search, tab controls
- Firefox 8 beta brings Twitter search, tab controls | Myfriendpal
- Firefox 8 beta brings Twitter search, tab controls | Custom Software Solutions (Antigua)-Digital World
- Firefox 8 beta brings Twitter search, tab controls
- TECHNOLOGY GADGETS - Firefox 8 beta brings Twitter search, tab controls
- Mozilla Releases Firefox 8 Beta, Includes Twitter Search
- Mozilla Releases Firefox 8 Beta, Includes Twitter Search
- FuTuRe BeAt….. - FuTuReBeAt.NeT......
- Firefox 8 beta brings Twitter search, tab controls | REDSTAB VIDEOS
- work in progress – turning on reftests in the new native UI for firefox on android | 3.1415926535897932384626433…
speed is really the most important thing.if xul is slowing things down,just get rid of it.
even if having noscript and adblock woild be nice,i am not using either on android atm because they add multiple seconds to the already long startup.
XUL isn’t the slow thing. It is waiting all of the support libraries to be loaded and ready to bring up a UI. Android already has the support libraries ready to go when you start an Android application if you write the application using the Android’s Native widgets.
Does that mean the embedding API will get a refresh ? if that’s true it’s really good news for plenty of side mozilla projects !!!
it isn’t clear, but I am pretty sure we will need to do something like that.
Isn’t the whole issue disappearing with time? I know I’m on a cutting edge of the technology but I remember booting my first Fennec on G1. I remember then booting it on Nexus One and then on Nexus S and now on Galaxy SII and Galaxy Tab 10.1….
It feels to me (and people I demoed it to) that under the latest generation things work really fast and smooth and it’s only about to get better with the Q4 generation of Android devices.
I understand that this is not the experience an average user has, but this technology will be pushed down to mainstream and with the current speed of technology adoption and iterations it feels like in 6-8 months my Mom will get her next phone with dual core Galaxy SII-like performance characteristics.
Is there something I miss out of the picture?
You can still buy Droid Pros today – they are basically the go-to RIM like android device. There will always be lower end devices, right?
on the fastest phone we have, we startup in 2 seconds. the default browser starts up an order of mag faster. If the world only had these kind of phones, I tend to agree with you. However, it is not. There is a long tail of lower end phones. ARMv6 phones are still being sold replacing feature phones. I’d love to ignore this problem…. hardware will fix this for us!!!
But our competition isn’t thinking that way nor do they have to load a library as big as libXUL before they show their UI. Our competition kicks our ass on very low end phones. Why can’t we compete?
We have such a great feature set. We are the browser for the people. But people aren’t sticking around.
Wouldn’t you get the best of both worlds if you made a sort of Firefox Home like on iphone? From there you could load fennec in the background and provide the full experience. I imagine the difficult part would be to provide a nice transition and inform the user that the full browser has started.
Also will this problem disappear with newer phones? Where is the bottleneck? IO, CPU? Would you need an x-25m in your phone to get to 300ms?
Electrolysis will remain or isn’t related?
I completely agree that “people aren’t sticking around”. I have been using Firefox as my default browser on all of my Mac machines (though I’ve recently had a few issues with FX7 that has me considering a switch to Chrome), yet I cannot bring myself to wait around for Fennec to load on my HTC EVO 4G. I’ve had Fennec installed several times only to ditch it. I can literally feel my blood pressure rise each time I see that “Loading” screen. LOL. At any rate, I’m using the stock browser baked into the CyanogenMod7 ROM I’ve installed and it suits my purposes. If Firefox gets its act together around a mobile version I may have to give it another look and try. Best of luck.
Awesome. I can’t wait to install it on my phone.
As a Mozilla developer, I’d like to use Firefox on my phone, for ideology and for tabs, but I can’t, it’s too slow and takes too much RAM. Thanks for doing this. It makes sense, the UI on Android should be minimal, so the UI work is limited.
As for extensions, if Addons SDK API is designed well enough, these addons should work in the native UI.