window.addEventListener("deviceorientation", function (e) {
// e is DeviceOrientationEvent object
// do something with e.alpha, e.beta or e.gamma.
});
iPhone を基準に Android の値を補正
if android and event.gamma > 180 then event.gamma -= 360