在歌Nexus S和Galaxy SII开启相机部件 [英] Turn on Camera from widget in Nexus S and Galaxy SII
问题描述
我写一个简单的小部件为Android设备。当用户preSS上的小窗口的摄像头手电筒必须关闭和开启。我的窗口小部件工作正常,当我启动它在索尼爱立信弧形,但是当我尝试推出小部件的的三星NexusS 的或的三星Galaxy SII 是的做什么(不工作)的
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 fine when I launch it on Sony Ericsson Arc, but when I try to launch Widget on Samsung NexusS or Samsung Galaxy SII it do nothing (doesn't work).
我谷歌这个问题,并找到一些答案吧。大多数的用户建议使用SurfaceView,真正表面观与大小1像素,如果它被放置在活动真正发挥作用,但 它不能在我的情况下工作(小部件不支持SurfaceViw) 。
I google this issue and find some answers for it. Most of users suggest to use SurfaceView and really surface view with size 1 pixel really work if it is placed on activity, but it doesn't work in my case (Widget doesn't support SurfaceViw).
<一个href="http://stackoverflow.com/questions/8876843/led-flashlight-on-galaxy-nexus-controllable-by-what-api/9379765#9379765">LED手电筒Galaxy Nexus的控制由什么API?
我发现这篇文章,这是非常有用的,但我怎么能在我的情况下使用它,在这种情况,如果我想打开光部件?我知道,因为它还不支持,任何想法,我不能用表面视图控件视图?
I found this article and it was very useful, but how can I use it in my case, in the case if I want turn on light from widget ? I know that I can't use Surface view in Widget View as it is not supported yet, any Ideas ?
请给我提供一些链接,开源项目或物品或东西,可以是对如何我可以把灯开/关从Nexus S的一和Galaxy S II的部件有帮助的。
Please provide me some links, open source projects or articles or something that can be helpful on how I can turn light on/off from the widget on Nexus S One and Galaxy S II.
有没有普遍的code与相机不同的手机工作?任何信息都将是有益的。
Is there any universal code for working with camera on different phones ? Any information will be helpful.
也许我需要用本机库?
Maybe I need to use native library ?
感谢。
推荐答案
目前没有官方Android API,让您独自操作相机闪光灯。您可以通过官方的摄像头API去 - 它并没有正式定义如何操纵闪光灯LED。您可以设置不同的模式,但摄像头的软件可以随意忽略它。
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.
所以,如果这个工程上索尼它不必vork其他硬件。有可能是(和最有可能有)尽管一些厂商特定的无证的API。
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.
这篇关于在歌Nexus S和Galaxy SII开启相机部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!