News for hackers. Stuff that matters.
Re:Google uses accelerometer API in Jules Verne Google Doodle by Hacktivist on Tuesday February 08, 2011 @01:29AM (#2192197)
Re:Google uses accelerometer API in Jules Verne Google Doodle by nostrademons on Tuesday February 08, 2011 @12:36AM (#2192087)
FYI, the accelerometer works on a MacBook Pro with Chrome or Firefox as well. I remember when Kris showed me the demo on his Mac, I was like "Wow, you can do that on a normal laptop?"
Re:Google uses accelerometer API in Jules Verne Google Doodle by ugh on Tuesday February 08, 2011 @01:59AM (#2192254)
All kinds of laptops have had accelerometers since the early 2000s or so. (IBM ran commercials for their ThinkPads with “airbag” all the time. Yep, this was already built into laptops when IBM still sold ThinkPads.) They stop the hard drive when accelerations get too extreme.
Re:Google uses accelerometer API in Jules Verne Google Doodle by lloeki on Tuesday February 08, 2011 @06:18AM (#2192560)
Yet having the accelerometer made usable by software is actually nice. It was (and still can be, sometimes in HD themselves) often a hardwired feature. Also, there's quite a gap in sensibility between detecting a drop and registering subtle variations of the acceleration vector.
Re:Google uses accelerometer API in Jules Verne Google Doodle by Isamu on Tuesday February 08, 2011 @09:24AM (#2192913)
I thought they stopped the drive when the acceleration is zero (freefall). If the acceleration is high, it's probably too late.
Re:Google uses accelerometer API in Jules Verne Google Doodle by ugh on Tuesday February 08, 2011 @09:28AM (#2192922)
That makes a lot of sense. Fun fact: The astronauts on the ISS use ThinkPads [0]. They would have to disable the accelerometer if their laptops had one.

(I’m now just going to claim that zero was the extreme I was referring to.)

[0] http://de.wikipedia.org/w/index.php?title=Datei:Susan_Helms_...

Edit: The laptop in question — model A31p from 2003 — doesn’t have an accelerometer. http://www.thinkwiki.org/wiki/Category:A31p

Re:Google uses accelerometer API in Jules Verne Google Doodle by logophobia on Tuesday February 08, 2011 @02:54PM (#2194524)
Zero acceleration only happens after an object has been falling for a long time (more then a few seconds) and the friction is in balance with gravity. Zero acceleration also happens when the laptop is just sitting on a table. Probably wouldn't be a good measure to stop the drive.

Initially, an object falling will accelerate with g=9.81m/s^2, after it reaches the ground it will de-accelerate to a speed of 0m/s in a couple of ms. You are confusing weightlessness/zero-g with no acceleration.

Re:Google uses accelerometer API in Jules Verne Google Doodle by Isamu on Tuesday February 08, 2011 @03:27PM (#2194670)
I'm talking about the acceleration that the sensor is measuring. If you are holding it still, it measures 1g toward the ground.

If the drive is falling, certainly it is accelerating toward the ground but the sensor measures zero acceleration. This is the relative frame of reference.

Re:Google uses accelerometer API in Jules Verne Google Doodle by pero on Tuesday February 08, 2011 @12:34AM (#2192082)
And which devices that support Firefox or Chrome actually have accelerometers? It doesn't work on my Froyo phone...
Re:Google uses accelerometer API in Jules Verne Google Doodle by jonah on Tuesday February 08, 2011 @01:27AM (#2192192)
ThinkPads, Mac Laptops
Re:Google uses accelerometer API in Jules Verne Google Doodle by mhansen on Tuesday February 08, 2011 @02:04AM (#2192265)
Doesn't work on my new Thinkpad T510, running Ubuntu and Chromium 9.0.

I know it has an accelerometer (I've seen the bundled Windows software use it), but I don't know where the API to access that data is.

Re:Google uses accelerometer API in Jules Verne Google Doodle by martey on Tuesday February 08, 2011 @03:08AM (#2192354)
See http://www.thinkwiki.org/wiki/HDAPS .

I am not sure whether Firefox or Chrome/Chromium on Linux will actually read the data that is provided by hdaps.

Re:Google uses accelerometer API in Jules Verne Google Doodle by mhansen on Tuesday February 08, 2011 @03:36AM (#2192394)
Thank you! :)
Re:Google uses accelerometer API in Jules Verne Google Doodle by SoftwareMaven on Tuesday February 08, 2011 @03:15AM (#2192363)
Works on my iPhone with Safari and my MacBook with Chrome, but not on my MacBook with Safari. Go figure.
Re:Google uses accelerometer API in Jules Verne Google Doodle by windsurfer on Tuesday February 08, 2011 @12:39AM (#2192091)
It doesn't only support Firefox and chrome, but my N900 has both and it works fine (though slowly).
Re:Google uses accelerometer API in Jules Verne Google Doodle by younata on Tuesday February 08, 2011 @12:40AM (#2192094)
the nexus 1/s, probably.
Re:Google uses accelerometer API in Jules Verne Google Doodle by nostrademons on Tuesday February 08, 2011 @12:42AM (#2192102)
Default Nexus 1 install has a Mobile Webkit browser, which doesn't even get the interactive version.

It works - somewhat - on an iPad - but there's a problem in that tilting the iPad makes the screen rotate and locking the screen seems to disable the tilt events.

Best experience is on a MacBook with Chrome, IMHO.

Re:Google uses accelerometer API in Jules Verne Google Doodle by pclark on Tuesday February 08, 2011 @07:10AM (#2192630)
Incredible that the clever google logo doesn't work on the google phone...
Re:Google uses accelerometer API in Jules Verne Google Doodle by younata on Tuesday February 08, 2011 @12:46AM (#2192113)
I just tried it with my mac. I was surprised that chrome had access to the accelerometers. I thought they were only used to make sure the hard drive doesn't die in case of dropage.
Re:Google uses accelerometer API in Jules Verne Google Doodle by 10char on Tuesday February 08, 2011 @01:10AM (#2192157)
Re:Google uses accelerometer API in Jules Verne Google Doodle by catch23 on Tuesday February 08, 2011 @02:02AM (#2192261)
where's the one that switching workspaces when you tap the left/right side of the laptop?
Re:Google uses accelerometer API in Jules Verne Google Doodle by estel on Tuesday February 08, 2011 @05:23AM (#2192494)
Ditto default Nexus S. Dang.
Re:Google uses accelerometer API in Jules Verne Google Doodle by ars on Tuesday February 08, 2011 @01:23AM (#2192186)
Spec (for webkit based browsers): http://dev.w3.org/geo/api/spec-source-orientation.html of how to access acceleration data.

Mozilla does it somewhat differently:

https://developer.mozilla.org/en/Detecting_device_orientatio...

Re:Google uses accelerometer API in Jules Verne Google Doodle by paulirish on Tuesday February 08, 2011 @02:45AM (#2192325)
You can view source on this page for the normalization code to harmonize both implementations:

http://studio.html5rocks.com/samples/orientation/index.html (see VideoPhysicsController.prototype._onTilt() )

Re:Google uses accelerometer API in Jules Verne Google Doodle by willscott on Tuesday February 08, 2011 @12:59AM (#2192142)
The accelerometer interaction hooks into javascript via browser events.

Here's the basic usage for chrome: (for firefox the event is MozOrientation, and values are radians rather than degrees)

  window.addEventListener('deviceorientation', function(evt) {
    var x = evt.gamma, y = evt.beta;
  }, false);
Re:Google uses accelerometer API in Jules Verne Google Doodle by ben1040 on Tuesday February 08, 2011 @09:27AM (#2192919)
Doesn't work on my 2010 Macbook Air. I was a little confused until it dawned on me that due to the SSD, Apple had no reason to build in an accelerometer.
Re:Google uses accelerometer API in Jules Verne Google Doodle by nrbafna on Tuesday February 08, 2011 @01:30AM (#2192199)
I navigated through the entire doodle just to see if there was something encoded in it as well, like in the cr-48 ad.
Re:Google uses accelerometer API in Jules Verne Google Doodle by tomwans on Wednesday February 09, 2011 @03:17AM (#2196816)
well ?
Re:Google uses accelerometer API in Jules Verne Google Doodle by Groxx on Tuesday February 08, 2011 @01:15AM (#2192166)
Huzzah for Whale Sharks[1]! Funky critters. The "Google" at the bottom is a nice touch, too.

[1]: http://en.wikipedia.org/wiki/Whale_shark

Re:Google uses accelerometer API in Jules Verne Google Doodle by chaosmachine on Tuesday February 08, 2011 @06:50AM (#2192607)
It would be interesting to log this data, and try to figure out how many users are leaning back, in a car, etc. I wonder what kind of patterns you'd see.
Re:Google uses accelerometer API in Jules Verne Google Doodle by jrockway on Tuesday February 08, 2011 @11:21AM (#2193396)
Doesn't work on Android? Sometimes Google confuses me.
Re:Google uses accelerometer API in Jules Verne Google Doodle by noonespecial on Tuesday February 08, 2011 @05:35AM (#2192511)
I didn't know they'd done it. I opened Firefox and grabbed my Macbook to head for the couch and was most surprised by the awesome.