开发者

Android: Continually Listen in Background for Camera Taking Photo

I'm very new to Android development (think started yesterday) and in my application I'm trying to listen for when the camera is used to take a picture. Also, I need to listen for this action all the time such that my application can "close", but it'll still be listening in the background for when the camera takes an image (my application will execute almost entirely in the background once it's setup initially). Anyway, I've been doing a ton of reading and searching online and such and I've found that the best way, probably, to do this is to use a BroadcastReceiver, but what I've not seen is a good example of setting something like this up. I'm actually just very confused how to set up the BroadcastReceiver and how to start it working. Could someone provide me with a good example of how this should be done? Has a开发者_开发技巧nyone ever used something like this to listen for the camera taking a picture? Will this method work for me even if the application is "closed"?

Thanks in advance for any help you can provide!


Check this article out. It explains usage of the different available sensors their listeners and how to tap into them. It isn't explicitly giving you code for you camera but should be enough to jump start your progress provided you know the basics.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜