Phonegap 如何访问陀螺仪、相机、地理定位器?
PhoneGap只是为了设计界面吗?据我所知,所有应用程序都像一个普通的 html 页面一样,只是它被单独编译到每个手机操作系统中。
Is phonegap just for designing an interface? As far as I've seen all applications are just like a normal html page, just that it is compiled into each phone OS separatelly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Phonegap 在我看来就像某种浏览器 shell,具有可通过 Javascript 和 html5 访问的增强型本机功能。
因此,在 Javascript 中打开套接字或访问相机对象将指示手机上运行的应用程序打开套接字或访问相机,并将数据传递回 Javscript。
通过这种方式,您可以使用 html5 和 Javascript 编写一个应用程序,并且它可以在所有手机上运行,因为 Phonegap 通过手机相应的 API 提供硬件接口。
Phonegap looks to me like some kind of browser shell, with enhanced native features accessible through Javascript and html5.
So opening a socket, or accessing a camera object in Javascript will instruct the app running on the phone to open the socket or access the camera, and pass the data back to Javscript.
This way you can code one app in html5 and Javascript, and it'll work on all phones since Phonegap provides the interface to the hardware through the phone's repective API's.