How to start the camera directly from a web page in android

寵の児 提交于 2019-11-28 04:29:11

问题


Im trying to make a webapp for Android in which i can upload pictures. I have a web page with a fileupload field. When I push the button I can choose which app i would like to use to choose the file to upload. Is it posible (and how) to have the camera app in this list? Or do I maybe need a special app for this?

Thanks in advance!


回答1:


Here is the code to get access to the new camera api's in android 3+ and iOS 6.

<input type="file" accept="image/*" capture="camera">

This will allow you to take a new picture or select one from the device library and then upload it to a web app.




回答2:


Check out PhoneGap. The included example includes the camera. The full set of PhoneGap camera API's is documented here.



来源:https://stackoverflow.com/questions/5296644/how-to-start-the-camera-directly-from-a-web-page-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!