iPhoneのSafariでは、JavaScriptを使って加速度センサーやジャイロセンサーを利用できます。本連載でも以前、iPhoneの加速度センサー/ジャイロセンサーを使ったGoogleマップの自動移動や水準器のサンプルを作成しました。 iOS 5.0以前の加速度センサー/ジャイロセンサーのAPIはiOSの独自仕様でしたが、2012年3月にリリースされたiOS 5.1では、W3Cが標準化を進めている「DeviceOrientation Event」APIが実装されています。 W3CのDeviceOrientation Eventは2012年7月現在、iOSだけでなくAndroidでも利用できます(4.0以降で対応)。iOS 5.1でW3C仕様に対応したおかげで、Android 4.0標準ブラウザ/Firefox/Chrome for Androidともに同じプログラムが利用できるように