什么时候可以使用html5访问相机、加速度计、GPS
我现在使用 appcelerator,因为它使我可以访问此功能,同时仍然允许跨平台开发。但是您认为我们什么时候可以使用 HTML5 来做这些事情呢?您认为这会是钛的终结吗?
I use now appcelerator because it gives me access to this functionalities while still allowing a cross-platform development. But when do you think it will we possible to do this things using HTML5? Do you think that would be the end of titanium?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据这篇博文,Safari Mobile 支持加速计演示(需要 Safari Mobile)。
GPS 可以通过 Javascript 中的 Geolocation API 访问,大多数人都支持现代浏览器,但显然只能在具有某种地理位置的设备上运行。
至于相机,我相信 PhoneGap 可以处理这个问题,但这可能是通过某种本机挂钩实现的。
虽然这并不能明确回答您的问题,但希望它能为您指明正确的方向!
According to this blog post, Safari Mobile supports accelerometer access through Javascript starting with iOS 4.2. There is also a demo (requiring Safari Mobile) included in the blog post.
GPS can be accessed through the Geolocation API in Javascript, which is supported by most modern browsers, but will obviously only work on devices with some sort of geolocation.
As for the camera, I believe PhoneGap handles this, but that is probably through native hooks of some sort.
While that doesn't definitively answer your question, hopefully it points you in the right direction!