Turn on Camera from widget in Nexus S and Galaxy SII

后端 未结 2 1726
孤独总比滥情好
孤独总比滥情好 2021-01-26 01:56

Problem Description

I am writing a simple Widget for Android Devices. When user press on the widget a Camera Flashlight must turn Off and On. My Widget works f

相关标签:
2条回答
  • 2021-01-26 02:11

    There is no official android API allowing you to manipulate camera flash alone. You have to go via official camera API - and it does not formally define how to manipulate flash LED. YOu can set different modes, but camera software can ignore it at will.

    So, if this works on sony it does not have to vork for other hardware. There could be (and most probably there are) some vendor specific undocumented APIs though.

    0 讨论(0)
  • 2021-01-26 02:27

    A bit late in response,however, the camera has to pass a surface on some devices in order to turn flash on. Given that surface view is not applicable, you need to implement a surface texture instead, available as of api 11

    0 讨论(0)
提交回复
热议问题