Orientation Update…
A few days ago, I blogged about orientation support in Firefox. I am happy to report that linux patches landed over the weekend. (We also have Window Mobile and Thinkpads running Windows patches in the review process.)
If you a linux laptop and have a few minutes, please download one of the Firefox Trunk nightly builds and try out orientation!
What to try?
http://people.mozilla.org/~dougt/ori.html
Let it run for a little bit, then shake your laptop (not responsible for any damage
). After you have a couple dozen responses, send me the results including what distro and laptop you are using.
Demos!
While you are testing things out, check out the demo Michael Ventnor (m.ventnor at gmail.com) put together:

http://dougt.org/random/orientationdemo/index.xhtml
Justin Dolske has a few demos too:
Jesse Ruderman also cleaned up the “ball” demo that I created making the animation smoother.
Help Wanted
There are still other platforms that I would like to support. I specifically would like to see Windows support using their Sensor API. If you are interested in helping, file a bug, cc me, and take a look at the other implementations.
Orientation in Firefox and beyond
One of the coolest apps I saw when the iPhone came out was the wooden balance game Labyrinth. You basically tilt your phone to move a ball around the screen, avoiding holes, and trying to get the ball to a goal. It made use of a feature of many modern devices — accelerometers.
Obviously clear that there should be a webapp for doing just that. What was missing was a javascript API.
In recent Mozilla trunk builds, I have added support for an orientation event. This new event will allow you to build applications and listen for changes in orientation. (note, the first platform to support such an event is any MacBook Pro. Others will follow).
Simple Call:
To use this new event, you will add an event listener as you normally would:
window.addEventListener(“MozOrientation”, orientationChange, true);
Your callback will be called, when there is a change in acceleration, passing the current orientation:
function orientationChange(o) {
}
Simple Result:
The passed object has 3 attributes – “x”, “y” and “z”. Each value is between -1 and 1 where zero is the “balance point”. For example, suppose you device is a MacBook Pro and it is sitting on a desk that is perfectly level, you would expect to see:
x = 0
y = 0
z = 1
x is the axis in the direction from the left side of the keyboard to the right side of the keyboard (basically the axis that is along the home row keys) is level. If I lift up the left side of the keyboard, x will increase. if I lift up the right side, x will decrease.
y is the axis in the direction from the front of the laptop (where the mouse is) to the back of the laptop. If I lift up the front of the laptop (the side closest to me), y will decrease. If I left the back towards the front, y will increase.
Got that? Yeah, physics is pretty hard.
x and y can easily be visualized. If you have a recent trunk build for the Mac, try loading this demo page:
http://people.mozilla.org/~dougt/ball.html
z basically will tell you that the laptop is sitting right side up. if z was -1, you would know that the laptop (probably closed) and is sitting on its screen. Of course the value will change as you rotate the laptop / device in this direction.
Right now, there is only support for the Macbook Pro. It is pretty easy to add support for different OSs. We have code for Samsung Windows Mobile devices, and for the HTC Windows Mobile devices. We still need support for linux and for Windows. If you are interested in adding support file a bug and start looking at http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIAccelerometer.idl
The API isn’t fixed and may change. I do invite you to comment. Keep in mind that we want a really simple and straight forward API to expose orientation events to web developers. If your response has either “RDF” or “DCCI” in it, please reread the last sentence.Â
Thanks again and hope you enjoy.
Eunice Kennedy Shriver
Eunice Kennedy Shriver died this week.
Best known as the founder of the Special Olympics, she reshaped how we think about people with mental disabilities. Mrs. Shriver ensured that people with mental disabilities have a place in our society, that they are guaranteed civil rights including access to an education.
Much of this you may have heard over the last few days. Unfortunately, I didn’t see any athletes speaking out. Here is one of my favorite videos. Enjoy!
Geolocation Address
Last week, I pushed a change that will enable tomorrow’s trunk Firefox builds (Minefield) to access user-readable position information.
For example, instead only being able to work with:
37.3882005, -122.0834553
You can see the physical address as:
650 Castro St, Mountain View, California, 94041, US
This should help aide the many people that already know their physical address in familiar terms.
To access address elements, you simply do what you have been doing. The only modification is to test to see if there is an address associated with the position, and if so, access it:
navigator.geolocation.watchPosition(successCallback)
function successCallback(position)
{
if (position.address)
alert(position.address.postalCode);
}
Other fields on the address object are:
address.streetNumber address.street address.premises address.city address.region address.county address.countryCode address.postalCode
Please let me know what you think.
all moved over…
all moved over to the dougt.org domain. I hope I didn’t lose too much along the away. I think some of the media didn’t make it through the conversation, but C’est la vie!
The start of the geolocation web.
Today, when you go to maps.google.com, you will notice something new:

See it? That little button between the map control and the street view man, when pressed, will enable geolocation for maps.
Other sites also have started adopting geolocation. Flickr has created a maps page that has a “Find my location” button that uses geolocation to position you and then show you pictures from your area:

What other cool sites have you seen?
Technorati Tags: geolocation, gps, location, mozilla
Geolocation "Page Info" in Firefox 3.5
Today, I updated the Page Info dialog in Firefox 3.5 to include Geolocation information. It now includes an easy way to see what permissions you granted to a particular page.

So to revoke permissions for a particular site:
* Navigate to the site to which you’ve given permission
* Go to the Tools menu, then select Page Info
* Select the Permissions tab
* Change the setting for Share Location
The default setting is to “Always ask”. Thanks to beltzner for pushing on this, and the entire l10n community for helping with the late changes.
Technorati Tags: geolocation, gps, location, mozilla
sully

skype
today i setup skype for my uncle. it was such a weird and awesome experience. Twenty plus years ago, he migrated from Portugal to the US and settled in California. He hasn’t been back home in a decade. Sadly, he was recently diagnosed with cancer, and he will not be flying again. One of his desires, i would imagine, would be to visit the the family he still has back in Portugal.
A week ago, he invited me over to help fix stuff around his house. Life kept me away, but today I managed to make it over there. I helped him with his internet connection and got him online again. While helping him figure out why stuff wasn’t working, I told him about Skype. Turns out that he has one relative that had an account. I installed Skype and that contact was online.
Using google translate, I told his relative who I was (apparently even using google translate, i am a faster typer). Everyone on both sides thought that that it was pretty incredible that I was able to do this. In any case, within a few seconds we had video chat going.
Although I barely speak Portuguese, I fully understood how this technology stuff has fundamentally made an impact on my uncle’s life. I was super proud of all of us technologists making hard stuff consumerized.
Error: update is null
If you are seeing this during the use of Geolocation: Error: update is null Source File: file:///C:/Programme/Mozilla%20Firefox%203.5%20Beta%204/components/NetworkGeolocationProvider.js Line: 218
Then you should be happy to know that we also see it, and it will be fixed for the RC.