0

I want to build an application that running in the background, that doing something exactly at the time that there is a camera capture on the device. I don't want to build a camera application by myself, I want that the application will detect any capture on the device, that can happen from any camera application that the user of the device want to use.

My question is: How can I detect a capture on device? Is there any Broadcast Reciever of that?

Thanks in advance!!

Itay
  • 219
  • 5
  • 14
  • 1
    "Is there any Broadcast Reciever of that?" -- no. And the only workaround I know of -- used mostly by malware authors -- is no longer possible as of Android 5.0, thankfully. – CommonsWare Oct 25 '14 at 21:25
  • @CommonsWare Do you know about any way that I can do this? It will be very helpfull!! – Itay Oct 25 '14 at 23:20
  • @CommonsWare: dosn't a [`ContentObserver`](http://developer.android.com/reference/android/database/ContentObserver.html) (like http://stackoverflow.com/a/6639103/192373) provide the necessary functionality? – Alex Cohn Oct 26 '14 at 11:19
  • See also [`android.hardware.action.NEW_PICTURE`](http://developer.android.com/reference/android/hardware/Camera.html#ACTION_NEW_PICTURE), but remember that 3rd party Camera applications are no guaranteed to perform this broadcast, see [_where is android.camera.NEW_PICTURE defined?_](http://stackoverflow.com/questions/3015448/where-is-android-camera-new-picture-defined) – Alex Cohn Oct 26 '14 at 11:30
  • @AlexCohn: Not based on the question. There is no requirement that a "capture" write anything to disk, let alone a location that might get picked up by a `ContentProvider` and any associated `ContentObservers`. Also, there is no requirement that the only things picked up by that `ContentObserver` be pictures from the camera, as other apps could write wherever the `ContentObserver` is observing. – CommonsWare Oct 26 '14 at 11:30
  • @CommonsWare: thanks, both your points are valid. I agree that neither `ContentObserver` nor `NEW_PICTURE` _action_ constitute an answer to this question. But maybe still the linked discussions may help the **TO** to better understand what is and what is not available on the platform. – Alex Cohn Oct 26 '14 at 11:36

0 Answers0