Is it possible to take a photo using Google Glass without “tap to accept”?

喜你入骨 提交于 2020-01-03 13:29:47

问题


I'm following the code here to capture an image with the Google Glass camera.

https://developers.google.com/glass/develop/gdk/media-camera/camera#capturing_images_or_video

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 1);

Everything is working fine, except that the camera activity requires the user to "tap to accept". Is it possible to just take the photo after a second or so?

This is how the built-in camera app works, I just say "ok glass, take a picture" and it takes a picture without requiring any additional confirmation. The camera in my app is already being activated by the user with other voice/taps in the interface so this second confirmation tap is undesirable.


回答1:


Instead of opening the Google Glass camera app, you could take the picture yourself: http://developer.android.com/training/camera/cameradirect.html

This is even mentioned in the GDK reference:

Building your own logic with the Android Camera API. Follow these guidelines if you are using this method:

  • Take a picture on a camera button click and a video on a long click, just like Glass does.
  • Indicate to the user whether a picture was taken or a video was recorded.
  • Keep the screen on during capture.



回答2:


You can use Cuxtom Cam library to perform that task that you want.



来源:https://stackoverflow.com/questions/21540978/is-it-possible-to-take-a-photo-using-google-glass-without-tap-to-accept

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