使用DeviceMotion实现,通过DeviceMotionEvent,可以获得accelerationIncludingGravity的x,y,z属性,根据x,y,z属性的变化来判断设备是否有摇一摇。
技术文章 / 下载软件趣味内容 / 专业带飞