Fennec/NativeUI: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
==Features==
== Features ==


* Awesome Bar – Go to your favorite sites in just a couple of keystrokes with intelligent and personalized searching
*Awesome Bar – Go to your favorite sites in just a couple of keystrokes with intelligent and personalized searching  
* Firefox Sync – Sync your Firefox tabs, history, bookmarks and passwords between your desktop and mobile device for a seamless browsing experience  
*Firefox Sync – Sync your Firefox tabs, history, bookmarks and passwords between your desktop and mobile device for a seamless browsing experience  
* Tabbed browsing – View open tabs as thumbnails to easily identify and select the Web page you’d like to go to next  
*Tabbed browsing – View open tabs as thumbnails to easily identify and select the Web page you’d like to go to next


* Fast - Instantly startup (<300ms)
*Fast - Instantly startup (&lt;300ms)  
* Small - Low memory usage (consistent with other browsers)
*Small - Low memory usage (consistent with other browsers)  
* Energy - Doesn't eat your battery
*Energy - Doesn't eat your battery


==Background==
== Background ==
[http://dougt.org/wordpress/2011/09/fennec-and-native-android-uis/]


==Nightly Builds==
[http://dougt.org/wordpress/2011/09/fennec-and-native-android-uis/]


If you want to try the new NativeUI on your Android device, you can download the latest nightly builds here: http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-birch-android/
== Nightly Builds ==


== How To Build ==
If you want to try the new NativeUI on your Android device, you can download the latest nightly builds here: http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-birch-android/
 
== How To Build ==


The project repository is here: http://hg.mozilla.org/projects/birch  
The project repository is here: http://hg.mozilla.org/projects/birch  
Line 37: Line 38:
  mk_add_options MOZ_MAKE_FLAGS="-j9 -s"
  mk_add_options MOZ_MAKE_FLAGS="-j9 -s"


<br>
<br>  


  hg clone http://hg.mozilla.org/projects/birch/ src
  hg clone http://hg.mozilla.org/projects/birch/ src
Line 46: Line 47:
  make -f client.mk
  make -f client.mk


=== Build for Mac&nbsp;OSX<br> ===
=== Build for Mac&nbsp;OSX<br> ===


Requirements : Mercurial (hg), autoconf-2.13 (Use Macports to install), Android SDK/NDK<br>
Requirements&nbsp;: Mercurial (hg), autoconf-2.13 (Use Macports to install), Android SDK/NDK<br>  
<pre>hg clone http://hg.mozilla.org/projects/birch/ src
<pre>hg clone http://hg.mozilla.org/projects/birch/ src
cd src
cd src
vi .mozconfig
vi .mozconfig
</pre>
</pre>  
Here's an example .mozconfig: <br>
Here's an example .mozconfig: <br>  
<pre>dd the correct paths here:
<pre>dd the correct paths here:
ac_add_options --with-android-ndk="$HOME/android-ndk-r6b"
ac_add_options --with-android-ndk="$HOME/android-ndk-r6b"
Line 74: Line 75:
ac_add_options --enable-application=mobile
ac_add_options --enable-application=mobile
ac_add_options --target=arm-linux-androideabi
ac_add_options --target=arm-linux-androideabi
</pre>
</pre>  
Build and intall on your device:<br>
Build and intall on your device:<br>  
<pre>make -f client.mk
<pre>make -f client.mk
make -C objdir-droid/ package
make -C objdir-droid/ package
adb install -r objdir-droid/dist/fennec-10.0a1.en-US.android-arm.apk
adb install -r objdir-droid/dist/fennec-10.0a1.en-US.android-arm.apk
</pre>
</pre>  
<br>
<br>  


==Architecture Overview==
== Architecture Overview ==


Get a bird's eye view of how the native UI version of Fennec is [[Fennec/NativeUI/Architecture_Overview|structured]]. There are also some examples of [[Fennec/NativeUI/Messages|messaging]] between Java and XUL/JS.
Get a bird's eye view of how the native UI version of Fennec is [[Fennec/NativeUI/Architecture Overview|structured]]. There are also some examples of [[Fennec/NativeUI/Messages|messaging]] between Java and XUL/JS.  


==Design==
== Design ==


The UI design is under revision, to make it simpler and to make more use of standard Android controls (i.e. hardware/system menu button, back button) and to make sure that more touchevents can be passed directly to web content.
The UI design is under revision, to make it simpler and to make more use of standard Android controls (i.e. hardware/system menu button, back button) and to make sure that more touchevents can be passed directly to web content.  


Overview and detail here: https://wiki.mozilla.org/Fennec/NativeUI/UserExperience
Overview and detail here: https://wiki.mozilla.org/Fennec/NativeUI/UserExperience  


==Known Issue==
== Known Issue ==


===Near Term===
=== Near Term ===
* tabs (dougt / ram)
* favicons
* Dialogs
** http auth (wesj)
** nsIPrompt (wesj)
** contextmenus (wesj)
** select/form input (wesj)
** cert auth (xul)
* door hangers (gcp)
** content permission (geolocation, desktop notification, indexedDb, OWA)
** popup permission
* preferences (alexp)
* bookmarking (blassey)
* Panning perf (clord)
* zooming perf (clord)
* IME (alexp)
* link styles (visited/unvisited)
* Don't initialize this early. https://github.com/snorp/mozilla-central/blob/faster/embedding/android/GeckoApp.java#L383. So far, the only usage is here: https://github.com/snorp/mozilla-central/blob/faster/embedding/android/GeckoAppShell.java#L1717 -- which is after a page has loaded. I would recommend the initialization happen right there, when the mDb is null. Or probably at the end of onCreate in GeckApp.java
* https://github.com/snorp/mozilla-central/blob/faster/embedding/android/AwesomeBar.java#L178 -- This can be moved to an AsyncTask. A database access can happen in the background and the results can be pushed to the UI. In that way, the responsiveness of AwesomeBar will be faster and better.
* Setting the FilterQueryProvider automatically processes the SQL in a background thread (see http://developer.android.com/reference/android/widget/CursorAdapter.html#runQueryOnBackgroundThread%28java.lang.CharSequence%29). I verified this by adding a Thread.sleep() call in the filter - the UI remains responsive.
* Better to use styles in layout. This helps in reusability. (sriram)
* <strike>GeckoApp activity uses a lot of static variables. This has issues while rotation (they tend to hold previous values). It's better to avoid static variables and use getter and setters. [see http://stackoverflow.com/questions/2475978/using-static-variables-in-android]</strike> (done as of 0c46f65505f0)
* Change directory structure under embedding/android to follow a more traditional Android app layout (src, res, gen, etc) for better integration with Eclipse.
* Take into account best-practices and coding conventions from http://developer.android.com/guide/practices/design/performance.html since the whole point of this is to speed up the UI. In particular, the current code:
** creates a lot of string objects which (from my past experience) triggers the GC mechanism more often and slows things down
** uses unnecessarily visible (public or package instead of private) and non-final variables, which prevents certain classes of compiler optimizations. (these are also just bad coding conventions)
* attach session history to browser elements, send SESSION_BACK message to nsAppshell from java to control session history
* On Galaxy Tab 10.1, the Awesomebar is not high enough, causing j's and g's to be cut short.


===Mid Term===
*tabs (dougt / ram)
*favicons
*Dialogs
**http auth (wesj)
**nsIPrompt (wesj)
**contextmenus (wesj)
**select/form input (wesj)
**cert auth (xul)
*door hangers (gcp)
**content permission (geolocation, desktop notification, indexedDb, OWA)
**popup permission
*preferences (alexp)
*bookmarking (blassey)
*Panning perf (clord)
*zooming perf (clord)
*IME (alexp)
*link styles (visited/unvisited)
*Don't initialize this early. https://github.com/snorp/mozilla-central/blob/faster/embedding/android/GeckoApp.java#L383. So far, the only usage is here: https://github.com/snorp/mozilla-central/blob/faster/embedding/android/GeckoAppShell.java#L1717 -- which is after a page has loaded. I would recommend the initialization happen right there, when the mDb is null. Or probably at the end of onCreate in GeckApp.java
*https://github.com/snorp/mozilla-central/blob/faster/embedding/android/AwesomeBar.java#L178 -- This can be moved to an AsyncTask. A database access can happen in the background and the results can be pushed to the UI. In that way, the responsiveness of AwesomeBar will be faster and better.
*Setting the FilterQueryProvider automatically processes the SQL in a background thread (see http://developer.android.com/reference/android/widget/CursorAdapter.html#runQueryOnBackgroundThread%28java.lang.CharSequence%29). I verified this by adding a Thread.sleep() call in the filter - the UI remains responsive.
*Better to use styles in layout. This helps in reusability. (sriram)
*<strike>GeckoApp activity uses a lot of static variables. This has issues while rotation (they tend to hold previous values). It's better to avoid static variables and use getter and setters. [see http://stackoverflow.com/questions/2475978/using-static-variables-in-android]</strike> (done as of 0c46f65505f0)
*Change directory structure under embedding/android to follow a more traditional Android app layout (src, res, gen, etc) for better integration with Eclipse.
*Take into account best-practices and coding conventions from http://developer.android.com/guide/practices/design/performance.html since the whole point of this is to speed up the UI. In particular, the current code:
**creates a lot of string objects which (from my past experience) triggers the GC mechanism more often and slows things down
**uses unnecessarily visible (public or package instead of private) and non-final variables, which prevents certain classes of compiler optimizations. (these are also just bad coding conventions)
*attach session history to browser elements, send SESSION_BACK message to nsAppshell from java to control session history
*On Galaxy Tab 10.1, the Awesomebar is not high enough, causing j's and g's to be cut short.


* Sync support (thebnich) ** see https://github.com/rnewman/clj-weave to start
=== Mid Term ===
** Talk to rnewman about this! :rnewman, rnewman on IRC. I am most happy to help.
 
* [http://limpet.net/mbrubeck/2010/05/10/fennec-meta-viewport.html &lt;meta name="viewport"&gt;] support (mbrubeck)
*Sync support (thebnich) ** see https://github.com/rnewman/clj-weave to start  
* page info
**Talk to rnewman about this!&nbsp;:rnewman, rnewman on IRC. I am most happy to help.  
* sharing
*[http://limpet.net/mbrubeck/2010/05/10/fennec-meta-viewport.html &lt;meta name="viewport"&gt;] support (mbrubeck)  
* Ability to pan around last screen shot.
*page info  
* Remove unused cruft from the APK.
*sharing  
*Ability to pan around last screen shot.  
*Remove unused cruft from the APK.


=== Longer term  ===
=== Longer term  ===
Line 145: Line 147:
*Touch events
*Touch events


=== Low priority bugs ===
=== Low priority bugs ===
* OpenURI is not supposed to load the frame, only provide the frame:
 
http://hg.mozilla.org/projects/birch/file/2f3d39316c54/mobile/chrome/content/browser.js#l80
*OpenURI is not supposed to load the frame, only provide the frame:
 
http://hg.mozilla.org/projects/birch/file/2f3d39316c54/mobile/chrome/content/browser.js#l80  
 
=== Other  ===
 
*<strike>The current helpers in browser.js are wrong or inadequate. This should be easy to fix. The code is also designed for a single &lt;browser&gt;. We need to add tab support (coming) and see that it works well in the XUL/Java setup.</strike> - mostly done in multiple changesets
*<strike>We are not using any Gecko session history (back/forward). I think this is a mistake. We should be capturing as much session in Gecko as possible. Any reason not to?</strike> done - cd8813d5469d
*We are not using favicons in awesomebar. Just missing? or intentional?
*<strike>URL edit box is not of "URL" type. The keyboard should change to show URL keys.</strike> done - b4bbaa96238a
*<strike>I like the JSON messaging from XUL to Java, but I think we need the reverse too.</strike> done - ca107c8ed542
*Also, GeckoAppShell.handleGeckoMessage could use a good refactor. It's already too big.
*Plans for splitting the work between non-visual Java components (like a History or Bookmark object), the visual Java UI (dialogs or buttons that use the non-visual components) and the XUL/JS helpers used to send/receive messages to Java. These seem to be the basic areas of coding. Planning how to attack any particular feature will help make sure we don't have coders stepping on each other and will make the work go faster IMO.


=== Other ===
*investigate using system sqlite, system zlib
*about:crashes sounds broken


* <strike>The current helpers in browser.js are wrong or inadequate. This should be easy to fix. The code is also designed for a single <browser>. We need to add tab support (coming) and see that it works well in the XUL/Java setup.</strike> - mostly done in multiple changesets
== QA ==
* <strike>We are not using any Gecko session history (back/forward). I think this is a mistake. We should be capturing as much session in Gecko as possible. Any reason not to?</strike> done - cd8813d5469d
* We are not using favicons in awesomebar. Just missing? or intentional?
* <strike>URL edit box is not of "URL" type. The keyboard should change to show URL keys.</strike> done - b4bbaa96238a
* <strike>I like the JSON messaging from XUL to Java, but I think we need the reverse too.</strike> done - ca107c8ed542
* Also, GeckoAppShell.handleGeckoMessage could use a good refactor. It's already too big.
* Plans for splitting the work between non-visual Java components (like a History or Bookmark object), the visual Java UI (dialogs or buttons that use the non-visual components) and the XUL/JS helpers used to send/receive messages to Java. These seem to be the basic areas of coding. Planning how to attack any particular feature will help make sure we don't have coders stepping on each other and will make the work go faster IMO.


* investigate using system sqlite, system zlib
*Contact: Kevin Brosnan (kbrosnan)
* about:crashes sounds broken
*Bugs: [https://etherpad.mozilla.org/fennec-native-ui-qa-bugs Fennec native UI testing]
*Notes: [https://etherpad.mozilla.org/testing-native-fennec Fennec native UI notes]


==QA==
== Weekly Showcase ==
* Contact: Kevin Brosnan (kbrosnan)
* Bugs: [https://etherpad.mozilla.org/fennec-native-ui-qa-bugs Fennec native UI testing]
* Notes: [https://etherpad.mozilla.org/testing-native-fennec Fennec native UI notes]


==Weekly Showcase==
*Wednesdays @ 12:00 PDT/Warp Core  
* Wednesdays @ 12:00 PDT/Warp Core
*Notes and Bugs 10-26-11
* Notes 10-26-2011
canmove, Confirmed users, Bureaucrats and Sysops emeriti
5,401

edits

Navigation menu