简体   繁体   English

HTML5 / javascript Android应用程序可以访问摄像机/录音机吗?

[英]Can an HTML5/javascript Android app access the camera/voice recorder?

I'm thinking of getting into Android app development and I hear HTML5 apps are becoming more popular now. 我正在考虑进入Android应用程序开发,听说HTML5应用程序现在变得越来越流行。 Can HTML5 + javascript be used to access media inputs on the phone, or is this only available to Java apps? 可以使用HTML5 + javascript访问电话上的媒体输入,还是仅适用于Java应用程序?

Thanks 谢谢

In pure HTML5/JS, you can't. 在纯HTML5 / JS中,您不能这样做。

But, you can use fameworks like Phonegap that provides JS libraries allowing you to access to the device capabilities such as GPS, camera, etc. 但是,您可以使用诸如Phonegap之类的fameworks,它提供JS库,使您可以访问设备功能,例如GPS,相机等。

Frameworks like Phonegap make this possible by providing a wrapper around the api of each device it supports, which can be called from your html5 application built using it. 诸如Phonegap之类的框架通过在其支持的每个设备的api周围提供包装器来实现这一目标,可以从使用该设备构建的html5应用程序中调用该包装器。 Check their site here or their api documentation for the camera api here . 检查他们的网站在这里或照相机API的API文档在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM