Can I programmatically access a smartphone's sensors through the browser and JavaScript?

前端 未结 4 1539
梦如初夏
梦如初夏 2021-01-18 16:22

Is it possible for me to programmatically access a smartphone\'s sensors (e.g. accelerometer, compass, etc. on an Android or iPhone device) through a browser webpage and Jav

4条回答
  •  醉梦人生
    2021-01-18 17:12

    This demo considers the iPhone movements on the three axis using the event.accelerationIncludingGravity object: http://www.omiod.com/iphone/acceleration-demo.php

    So far Safari on iPhone is the first to implement it, but I see Android filling this gap very soon.

提交回复
热议问题