tag:blogger.com,1999:blog-9865097934573200902024-03-12T16:01:38.401-07:00on QualityJohn Hammink on music, writing, language, and quality.John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-986509793457320090.post-86454094117896691212013-02-24T00:25:00.001-08:002013-02-24T00:25:25.404-08:00Keynote on Firefox OS at Campus Party Recife!<div dir="ltr" style="text-align: left;" trbidi="on">
NOTE: I put this up on my blog almost 6 months ago - and never realized it didn't get published at the time! <br />
<br />
<a href="http://christianheilmann.com/" target="_blank">Chris Heilmann</a> and I just finished our keynote at <a href="http://recife.campus-party.org/2012/index.html" target="_blank">Campus Party Recife</a> in this lovely Brazillian coastal town. It's amazing to see the enthusiasm and momentum around <a href="http://en.wikipedia.org/wiki/Firefox_OS" target="_blank">Firefox OS</a> in the community.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMvBG77N3_t8ROdaADkgPauT0pBCuGS5dKrGtQCd2mj0IWmRRcj8lavBKQ13KMBOY8C0oe0UIogUIZ5OkDebx5knzLyUhW45jxmKt9Ha1pCuYEa7CpG-QilZ8W7ZWQ5F7ylCKP8_aMXPz-/s1600/keynote_campus_party.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMvBG77N3_t8ROdaADkgPauT0pBCuGS5dKrGtQCd2mj0IWmRRcj8lavBKQ13KMBOY8C0oe0UIogUIZ5OkDebx5knzLyUhW45jxmKt9Ha1pCuYEa7CpG-QilZ8W7ZWQ5F7ylCKP8_aMXPz-/s320/keynote_campus_party.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The boy in the picture is hearing for the first time.</td></tr>
</tbody></table>
Led by Chris (with some added points on the <a href="https://wiki.mozilla.org/WebAPI" target="_blank">APIs</a> themselves from me), the presentation started with a short bit about Mozilla's history and (open) values and traced the (very fast) evolution of our <a href="https://wiki.mozilla.org/WebAPI" target="_blank">Web APIs</a> toward a hardware-accessible web.<br />
<br />
In the same spirit as we did with the Browser Wars before, we (Mozilla) are taking on the Mobile OS lockout being faced currently in developing countries like Brazil.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBSiIsVMOcjCeLId0Ut5mSJJDNyaiVp-p2D4D2ma2X5tpYuVU0cB0UtLoDwAFCuDO5BoWB9OSB-6Z_a46bY45VKSx1eiu_T_U2NN9DBRuWO6HgDssC71qic3CNzUSl05HQdKOQjb3K88Yz/s1600/lock_out+.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBSiIsVMOcjCeLId0Ut5mSJJDNyaiVp-p2D4D2ma2X5tpYuVU0cB0UtLoDwAFCuDO5BoWB9OSB-6Z_a46bY45VKSx1eiu_T_U2NN9DBRuWO6HgDssC71qic3CNzUSl05HQdKOQjb3K88Yz/s320/lock_out+.png" width="320" /></a></div>
<br />
<br />
<br />
Simply put, if you can't afford it, you can't have it! And an Android phone is alot more expensive (relatively speaking) for a consumer in a developing country like Brazil than it is for us North Americans or Europeans.<br />
<br />
By enabling mobile application and content development in longtime-proven technologies like HTML5, CSS and JavaScript, Mozilla aims for critical mass in developer space (meaning there are much lower barriers to entry where any webpage can be an app!) It's "write once run anywhere" for real, and it's already been around a while. <br />
<br />
Already, with Telefonica on board (with their open web device initiative) and talks happening with several more phone and service providers, it's no wonder our audience more than doubled expected capacity!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWtDd4yWa6YvSETukpS2wFleEQfzAs6QPaluIYiyY_jnVS_wwf87YUI0g49L9eTVlIxkO-84zMIgBZRdBgfuTIoapa3qoL75_FNwvaawSCupnu_GchJPBJfvInlDo7MKUI7Cy_mTxTYuKT/s1600/IMG_4358.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWtDd4yWa6YvSETukpS2wFleEQfzAs6QPaluIYiyY_jnVS_wwf87YUI0g49L9eTVlIxkO-84zMIgBZRdBgfuTIoapa3qoL75_FNwvaawSCupnu_GchJPBJfvInlDo7MKUI7Cy_mTxTYuKT/s320/IMG_4358.JPG" width="320" /></a></div>
<br />
<br />
Typical questions centered around"How will this shake up the existing hegemony?" and "Will this run on my device?" While we're currently limited by the practical and proprietary limitations of porting hardware abstraction layers, we hope that, for starters, by driving a critical mass of developers toward Open Web Apps and Firefox OS, that we can affect the current of change in this space.<br />
<br />
As with all things Mozilla, this followed up with an appeal for community. Yes, we need YOU, to help us test, to help us develop, to help us translate, and to evangelize in your language.<br />
<br />
To this end, there was an appeal to the <a href="https://wiki.mozilla.org/ReMo/SIGs/Evangelism_Reps" target="_blank">Evangelism Reps</a> program (which yours truly is test driving at the moment!)<br />
<br />
Slides for our presentation are available here <a href="http://www.slideshare.net/cheilmann/mozilla-the-web-and-you" target="_blank">with notes</a> and <a href="http://www.slideshare.net/cheilmann/mozilla-the-web-and-you-no-notes" target="_blank">without notes</a>. More information and links can be found in the presentations themselves.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.com27tag:blogger.com,1999:blog-986509793457320090.post-78451645272831275832012-02-02T18:03:00.000-08:002012-05-10T00:58:47.261-07:00Part 2: Setting up Marionette for automating WebAPI testing on B2G<div dir="ltr" style="text-align: left;" trbidi="on">
NOTE: This article is now available as a series of articles on <a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/" target="_blank">MDN</a>: <a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/">https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/</a> and will be maintained and updated there.<br />
</div>John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.com1tag:blogger.com,1999:blog-986509793457320090.post-80423632594698344752011-12-27T17:17:00.000-08:002011-12-27T17:31:19.748-08:00Zippity - and automated performance tests for Firefox Mobile<div dir="ltr" style="text-align: left;" trbidi="on">
Many have wondered how we get the device coverage with our automated Performance tests. Here's one way:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/wIx5wLVaICs?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
What you see running here are the Zippity tests (a <a href="http://people.mozilla.com/%7Emfinkle/addons%20" target="_blank">plug in available</a> for <a href="http://nightly.mozilla.org/" target="_blank">Firefox mobile </a>), running the pageload tests on a number of different devices. I also have logcat attached and running, to catch any possible crashes.<br />
<br />
Pageload tests load a series of predefined webpages, to gauge pageload speed. There are also Startup tests (which start the application several times to measure startup speed); as well as SunSpider and V8 tests. Lastly, you can ping your memory metrics to Zippity. <br />
<br />
Having the crowd available to help run these tests (just install the plug in), helps us get the device coverage up and ensures we find things like native crashes, hopefully sooner, rather than later.<br />
<br />
Kudos to <a href="http://starkravingfinkle.org/blog/" target="_blank">Mark Finkle</a> for this great tool. <br />
<br />
<br /></div>John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.com0tag:blogger.com,1999:blog-986509793457320090.post-35365022644788282632011-12-11T15:55:00.001-08:002011-12-13T15:46:05.138-08:00A plug for the Fullscreen, Gamepad, and Mouse Lock gaming APIs<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="font-family: Arial,Helvetica,sans-serif; text-align: left;" trbidi="on">
<span style="font-size: small;">Sometimes, when things are moving as quickly as they generally do here at <a href="http://www.mozilla.org/" target="_blank">the Moz</a> (as in the open web generally), the best that one can do is channel the work of others to try and stay on track with everything. It certainly beats trying to do everything oneself, at the breakneck speed at which envisioning the new technology - and technology itself - unfolds.</span><br />
<span style="font-size: small;"><br /></span><br />
<span style="font-size: small;">On that note, kudos to <a href="http://vocamus.net/dave/" target="_blank">Dave Humphries</a>, <a href="http://rawkes.com/" target="_blank">Rob Hawkes</a> and <a href="http://blog.pearce.org.nz/" target="_blank">Chris Pearce</a> for their recent <a href="http://hacks.mozilla.org/2011/12/paving-the-way-for-open-games-on-the-web-with-the-gamepad-and-mouse-lock-apis/" target="_blank">blog</a> <a href="http://blog.pearce.org.nz/2011/11/firefoxs-html-full-screen-api-enabled.html" target="_blank">posts</a> on these brand new APIs. And so, by way of a rehash...</span><br />
<span style="font-size: small;"><br /></span><br />
<span style="font-size: small;"><as 12th,="" <b="" december="" of="" the="">Fullscreen, <b>Gamepad</b> and <b>Mouse Lock APIs</b> are available in a single experimental desktop <a href="http://people.mozilla.com/%7Etmielczarek/mouselock+gamepad/" target="_blank">build</a> of Firefox. There are also builds that support these features <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/david.humphrey@senecac.on.ca-ec560c67351d/try-linux/" target="_blank">here</a>.<br />
<br />
These APIs are estimated to land soon in the nightly builds.</as></span><br />
<span style="font-size: small;"><as 12th,="" <b="" december="" of="" the=""><br />
</as></span><br />
<span style="font-size: small;"><b>The Fullscreen API:</b></span><br />
<span style="font-size: small;"><b><br /></b></span><br />
<span style="font-size: small;">Scheduled to ship in firefox 10 by the end of January, you can still try out some of the examples in the latest <a href="http://nightly.mozilla.org/" target="_blank">nightly builds</a>.</span><br />
<span style="font-size: small;"><br /></span><br />
<span style="font-size: small;">Based on the <a href="https://wiki.mozilla.org/RapidRelease/Calendar" target="_blank">W3C's draft spec</a>, this API enables any HTML element to be made "fullscreen", which hides the browsers UI and stretches the element to cover the entire screen area. </span><br />
<span style="font-size: small;"><br /></span><br />
<span style="font-size: small;">To use it, the developer calls void </span><span class="Apple-style-span" style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">mozRequestFullScreen()</span>, which, if the request is granted (there are security implications here) gets a <span class="Apple-style-span" style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">mozfullscreenchange</span> event back to the specifying element; otherwise a <span class="Apple-style-span" style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">mozfullscreenerror</span> is dispatched.<br />
<br />
The user can ESC or F11 to exit full screen mode. As with YouTube or other fullscreen videos, navigating (ALT+TAB) will cause fullscreen mode to exit. <br />
</span></span></span><br />
<div style="text-align: center;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></span><br />
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;">There is a cross-browser full-screen API example <a href="http://html5-demos.appspot.com/static/fullscreen.html" target="_blank">here.</a> </span></span></span></div>
<div style="text-align: left;">
<br />
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><b>The Gamepad API:</b></span></span></span></div>
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="background-color: white; font-size: small; line-height: 20px;"><b><br /></b></span></span></span></span></div>
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="line-height: 20px;">As directed by the <a href="http://dvcs.w3.org/hg/webevents/raw-file/default/gamepad.html" target="_blank">W3C spec</a>, Javascript and Firefox now gives developers the possibility to connect a gamepad directly to the computer (using USB or Bluetooth) - a domain previously only available to gaming consoles and native computer games. </span></span></span></span></span></div>
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="line-height: 20px;"><br /></span></span></span></span></span></div>
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="line-height: 20px;">You can <a href="https://bug604039.bugzilla.mozilla.org/attachment.cgi?id=565617" target="_blank">try it out</a> here; note that you''ll need that custom <a href="http://people.mozilla.com/%7Etmielczarek/mouselock+gamepad/" target="_blank">build</a><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="line-height: 20px;">. This <a href="https://wiki.mozilla.org/GamepadAPI" target="_blank">wiki page</a> contains more implementation specifics.</span></span></span></span></span></span></span></div>
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="background-color: white; font-size: small; line-height: 20px;"><b><br /></b></span></span></span></span></div>
<div style="text-align: left;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="line-height: 20px;">Rob Hawkes made a great demo video:</span></span></span></span></span></div>
<div style="text-align: left;">
<div style="text-align: center;">
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="background-color: white; font-size: small; line-height: 20px;"><b><br /></b></span></span></span></span></div>
</div>
</div>
<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-size: small;">
</span></span></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><iframe allowfullscreen="" frameborder="0" height="225" mozallowfullscreen="" src="http://player.vimeo.com/video/31906995" webkitallowfullscreen="" width="400"></iframe></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><b>The Mouse Lock API:</b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><b><br /></b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;">This API hides the cursor and locks it to the center of the screen, thus enabling developers to make games and visualizations of a 3D world (otherwise the cursor would go off the side of the screen or hit the edge). With the cursor locked, the user can roam X, Y, Z axes without restrictions.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><b><br /></b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><a href="http://vocamus.net/dave/?p=1393" style="line-height: 19px;" target="_blank">David Humphrey and his students at Seneca College</a> are currently implementing this API based on the W3C <a href="http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html" target="_blank">spec.</a></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;">There are <a href="http://humphd.github.com/mozilla-central/mouselock/" target="_blank">demo files</a> available.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><br /></span></div>
<div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: center;">
<span style="font-size: small;"><iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/0aF7qWMawJM?feature=player_embedded' frameborder='0'></iframe></span></div>
<div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: center;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;">We're tracking Mouse Lock API on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602" target="_blank">Bugzilla</a>. You can also check out <a href="http://vocamus.net/dave/" target="_blank">David Humphrey’s series of posts</a> on the development of the Mouse Lock API.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;">I'm just now trying these out myself; of course, if you find any issues, please feel free to <a href="http://shrt.st/2b9i" target="_blank">file a bug</a>. </span></div>
</div>
John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.com4tag:blogger.com,1999:blog-986509793457320090.post-51586195048779634762011-11-28T13:49:00.001-08:002011-12-12T14:58:24.419-08:00Let's have a look at some recently landed Web APIs for Firefox<div dir="ltr" style="text-align: left;" trbidi="on">
So, without further ado (as there's been too much "to do" about it) let's take a look at what we presently have (landed or about to land) regarding our latest (Firefox) Web APIs.<br />
<br />
You'll need the latest <a href="https://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-android-xul/">xul fennec builds</a> to run these. Technically, these also run on the latest birch nightly, but that one is presently undergoing a major facelift due to rendering and related issues.<br />
<br />
I'd suggest using a tablet. (For the SMS app, you'll need a phone with simcard and a <a href="http://people.mozilla.org/%7Ejhammink/android_builds_4_testing_webapi/for_SMS_API/fennec-11.0a1.en-US.android-arm.apk%09">special build</a>, but we'll get to that presently).<br />
<br />
All example testpages to which we'll be referring are available under the directory at: <a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/">http://people.mozilla.org/~jhammink/webapi_test_pages/</a><br />
<br />
If you find a bug with any of the demos and/or APIs themselves (and we hope you will:) please write them here:<br />
<a href="http://shrt.st/2adv">http://shrt.st/2adv</a><br />
<br />
Make sure to include your device model & Android version, as well as the nightly fennec version you are using, in the bug.<br />
<br />
<b>Battery API demo:</b><br />
<a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/BatteryAPIdemo.html">http://people.mozilla.org/~jhammink/webapi_test_pages/BatteryAPIdemo.html</a><b> </b><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMayb9Gq4fi7DGEY7V5uXIKFdW8WOb089Ta7wjZ_nw3Nmvy0fftjFLRkOatMt-KS2azLTy_-ilc1jK3qB-FNscutDhV8wHBOsm28fb6x3TxOGGF6T5QHA-DGjqZ8YrQLBsPy7Gjvm4q6Uq/s1600/SC20111128-142031.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMayb9Gq4fi7DGEY7V5uXIKFdW8WOb089Ta7wjZ_nw3Nmvy0fftjFLRkOatMt-KS2azLTy_-ilc1jK3qB-FNscutDhV8wHBOsm28fb6x3TxOGGF6T5QHA-DGjqZ8YrQLBsPy7Gjvm4q6Uq/s320/SC20111128-142031.jpg" width="320" /></a>This API tests the different charging states of the battery, along with charging level and discharging time.<b> </b>Try launching the page with the device plugged in, and then unplugging (and/or vice versa). Note that the charging/discharging time presently shows <i>Infinity </i>until the battery has charged/discharged about 2% of its total capacity.<br />
<br />
Does the testpage show the correct battery state for the device? Does it correctly generate an alert when the charging state changes? Is the level correct (when compared against native battery app level)? Does it give a numerical discharging/charging time <b></b>after some time in the same charging state?<br />
<br />
<b>Camera API demo:</b><br />
<a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/CameraAPIdemo.html">http://people.mozilla.org/~jhammink/webapi_test_pages/CameraAPIdemo.html</a><b> </b><br />
This API presently tests the browser's ability to directly capture pictures from the device camera. <br />
<br />
Point the device camera at the object you want to shoot<b> </b> and click capture.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj23Vtt3qHuaFiz-Cl4jSnuqrs4xx-LWbm1Ho08y1yXOU2VP8MS94hlHpg1cL5Wx9LLYvUdkidXiAO5VeJMqKxPVD4wIB_8s9mrcEIQVfUTanL-Lboi9zrsigXgrATmTr8-TXOjGozz8vT/s1600/SC20111128-143915.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj23Vtt3qHuaFiz-Cl4jSnuqrs4xx-LWbm1Ho08y1yXOU2VP8MS94hlHpg1cL5Wx9LLYvUdkidXiAO5VeJMqKxPVD4wIB_8s9mrcEIQVfUTanL-Lboi9zrsigXgrATmTr8-TXOjGozz8vT/s320/SC20111128-143915.jpg" width="320" /></a></div>
<br />
Is the picture rendered correctly (as opposed to upside down, or sideways) both in the pre-capture and the preview? Is the picture quality consistent with what your camera normally delivers? Are there any other issues? Please feel to play around with it a bit.<br />
<br />
<b>IndexedDB API demo:</b><br />
<a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/IndexeddbAPIdemo.html">http://people.mozilla.org/~jhammink/webapi_test_pages/IndexeddbAPIdemo.html </a> <br />
<br />
Since accessing the native file system from the web introduces a huge risk, there needs to be a way to handle offline storage directly on a device. Enter IndexedDB. Actually, this api has been around since Firefox 4 (and subsequently for quite a few Chrome and other browser versions since) but the <a href="http://www.w3.org/TR/IndexedDB/">W3C spec</a> got a rewrite recently and it's been well overdue for an upgrade.<br />
<br />
When the browser first tries to create a local database, a prompt requests permission:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVLEMmSd_0mnju5dSIdiJ7Pp8syk4oPfEGexpbiuOCaAbpMq8nLTuz6WQz2iFnxqhPUapN3ZDHLGiXQ9Y_iHceBd3xbPVAO5aG6voIw7Ogeyo_VN_hSZVTVTyiORnLRP_Kx6bgwDFSnOu8/s1600/SC20111128-154911.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVLEMmSd_0mnju5dSIdiJ7Pp8syk4oPfEGexpbiuOCaAbpMq8nLTuz6WQz2iFnxqhPUapN3ZDHLGiXQ9Y_iHceBd3xbPVAO5aG6voIw7Ogeyo_VN_hSZVTVTyiORnLRP_Kx6bgwDFSnOu8/s320/SC20111128-154911.jpg" width="320" /></a></div>
<br />
Subsequently, once this is allowed, the db initializes, and after some time, reports back on the number of records:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQKWq9mX8EKhbyKwnDufsJNvQLiq97nVTBhMrBoyZvzjLtNVUjQz3-M75V0Tpj9WvVNK3tCuTm57239CFN3REpDfpEKIdLgDUkiltrlnRGbtFj2M3vd45sahFnNi6vvjeY6QTOVLCqGHy6/s1600/SC20111128-154913.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQKWq9mX8EKhbyKwnDufsJNvQLiq97nVTBhMrBoyZvzjLtNVUjQz3-M75V0Tpj9WvVNK3tCuTm57239CFN3REpDfpEKIdLgDUkiltrlnRGbtFj2M3vd45sahFnNi6vvjeY6QTOVLCqGHy6/s320/SC20111128-154913.jpg" width="320" /></a></div>
<br />
<br />
Our current demo matches a hash of zipcodes against a city (you must have zipcodes.csv present in same dir to work - this demo does), doing all the database access operations. (Note that we're presently missing the functionality to do the reverse!) Once the CSV is loaded into the device local database, the lookup should be instantaneous (note that all the steps are not depicted here):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV3qNwdKHWR6U7xBYMAEMPljfhxPsLvLEKH7-HHPOI8GTq9iMe0a3ryzpmRHhVjHquig21ZzboE4QXEUxHZcx_OWeVqNBNR6h1fYFzRBqPCK6hh8CprF7zx4rG2YLPNzWMFRyuQ45cWydm/s1600/SC20111128-155321.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV3qNwdKHWR6U7xBYMAEMPljfhxPsLvLEKH7-HHPOI8GTq9iMe0a3ryzpmRHhVjHquig21ZzboE4QXEUxHZcx_OWeVqNBNR6h1fYFzRBqPCK6hh8CprF7zx4rG2YLPNzWMFRyuQ45cWydm/s320/SC20111128-155321.jpg" width="320" /></a></div>
Note that I've been getting dramatically different results from device to device. Sometimes it works, sometimes not. To be sure the feature is still a work in progress, so let me know what your experiences are.<br />
<br />
<b>Vibrator API demo:</b><br />
<a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/VibratorAPIdemo.html">http://people.mozilla.org/~jhammink/webapi_test_pages/VibratorAPIdemo.html</a><b> </b><br />
<b> </b><br />
Web apps, just like native ones, need a way to send feedback to various sensors - including notification vibes. The W3C spec lays a foundation, which we've <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=679966">implemented</a>. Note that you'll need a device with a vibrator to test this one:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ8wmbuXpv49QoZJCHFWiHYdpEfhHS-rywYTpP-u1n2hhU4JP78WxnKBT-ee9dq-41Vcoa_DrX1RGLVUMjEbAo4PYCDoEphGoQ2T_WYVWCZXm0sW2E5aIKpOOEDhcUcledJ-yvoXm9udkl/s1600/SC20111128-161315.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ8wmbuXpv49QoZJCHFWiHYdpEfhHS-rywYTpP-u1n2hhU4JP78WxnKBT-ee9dq-41Vcoa_DrX1RGLVUMjEbAo4PYCDoEphGoQ2T_WYVWCZXm0sW2E5aIKpOOEDhcUcledJ-yvoXm9udkl/s320/SC20111128-161315.jpg" width="320" /></a></div>
<br />
You'll need a special <a href="http://people.mozilla.com/%7Ejhammink/android_builds_4_testing_webapi/for_vibrator_API/fennec-vibrator.apk" target="_blank">build</a> for this one also. Try out each of the scenarios and verify the result. Are we getting the correct number of buzzes, given the spec? As with any of our APIs here, you can check the implementation by typing the string "view-source:" (without the quotes) before the "http://....". Try it.<br />
<br />
<br />
<b>SMS API demo:</b><br />
Note that you'll need an android phone with a working SIM card to try these demos. Until this feature lands, you may also may also need a <a href="http://people.mozilla.org/%7Ejhammink/android_builds_4_testing_webapi/for_SMS_API/fennec-11.0a1.en-US.android-arm.apk">special build</a> with this feature.<br />
<b><br /></b><br />
<a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/SMSAPI_simplesend.html">http://people.mozilla.org/~jhammink/webapi_test_pages/SMSAPI_simplesend.html</a><b><br /></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_VA7ZD4LCJnFpnjawgOC9palEDH2gKRq3ezxZyHov9NSneMCA88UPSltVpLyL-Nqqj0uBmJ0MZyumVzZ0dYYXTDwe85EPq3oPi22-pTwMPNDvdSloZfA36amPMgIKxUpnDCilimhxeiH8/s1600/SC20111128-162229.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_VA7ZD4LCJnFpnjawgOC9palEDH2gKRq3ezxZyHov9NSneMCA88UPSltVpLyL-Nqqj0uBmJ0MZyumVzZ0dYYXTDwe85EPq3oPi22-pTwMPNDvdSloZfA36amPMgIKxUpnDCilimhxeiH8/s320/SC20111128-162229.jpg" width="320" /></a></div>
<br />
The simplesend is a page that lets you send SMS messages to any phone. Try it! Is your message able to get through? Any other issues? Note that, for testing purposes, you can also try sending the messages directly to the same phone from where they originate.<br />
<br />
This next example lets you do exactly that: send and receive SMS messages from the same webpage instance:<br />
<a href="http://people.mozilla.org/%7Ejhammink/webapi_test_pages/SMSAPI_send_receive.html">http://people.mozilla.org/~jhammink/webapi_test_pages/SMSAPI_send_receive.html</a><br />
<br />
This page is similar to the previous one, but also has an event handler for incoming messages.<br />
<br />
Don't forget to study the page source, for each of these pages, to understand how these APIs are implemented. <br />
<br />
And, once again, don't hesitate to <a href="http://shrt.st/2adv">file a bug</a> if something doesn't appear to be working correctly, or if you have an idea about some features you'd like to see. <br />
<br />
<b>Addendum: </b>The Web API test pages are now available in github: <a href="https://github.com/jhammink/WebAPI-test-pages">https://github.com/jhammink/WebAPI-test-pages</a></div>John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.com38tag:blogger.com,1999:blog-986509793457320090.post-12039724603768898222011-11-21T00:20:00.001-08:002011-11-21T16:07:15.055-08:00Mozilla's Web API - on testing a framework.<div dir="ltr" style="text-align: left;" trbidi="on">
So, hello again to you all. It's been ages since I last posted at this space - but for good reason: I've taken my performance show on the road again, and, at the same time, begun my work at Mozilla. I find myself, once again, in the happy place of doing, on a daily basis, two different things that I love.<br />
<br />
Primarily, my work has been around our <a href="http://hacks.mozilla.org/2011/08/more-details-about-the-webapi-effort/">Web API</a>, and how we will write -and eventually automate - tests against it. But how will we do this?<br />
<br />
Our API is intended to "expand what the web can do". One of the most important implications is the ability to access - in a secure fashion - our device hardware from the web. To that end, there are such things as Vibrator API, Battery API, Settings API, Accelerometer and Sensor API, a new and improved Geolocation API, Sound API....from which we can work our device directly from the web!<br />
<br />
So, how does one test a bunch of APIs as a user would use them? Well, one thing (and I've been involved with such an effort before) is to build an Application Framework - essentially a series of mock-up and atomic apps that each demonstrate a single API. <br />
<br />
Over time, these atomic apps will be folded into more feature rich ones - to demonstrate the capabilities and (hopefully - we're QA after all) reveal any bugs that mixing and matching these APIs will uncover.<br />
<br />
Another aspect that is important - particularly where automation is concerned - is a way of getting "golden values". We will build a series of simple native applications for each OS that will help us to obtain these values for comparison.<br />
<br />
Watch this space - in the (very near) future we will demonstrate how many of the web apis work; how we will build HTML/JS test pages around them and test many of the features as a user would use them; build our golden apps in java and/or python (depending on our target platform), and, eventually, work the lot into an automation framework. All of the code will be freely available on github.<br />
<br />
I'm hoping for many outcomes; one of them being that you will learn (if you don't know already) how any of the technologies depicted here actually work, but also that you might jump in and help out - when the time is ready - by expanding what we've started here and our web api testpages, enriching our automation core apps, and really putting those apis through the paces, at their intended purpose.<br />
<br />
Stay tuned!</div>John Hamminkhttp://www.blogger.com/profile/02100058778549982229noreply@blogger.com27