0

I am Developing an android application that should record the change state of the camera device in my phone in which every time I open the camera from any other application in my phone this application should save that application "X" open the camera at time "Y" and so on.

I have reached in my code to record the time that the camera was opened and close but I could not figure out how to discover the program name who has held the camera.

Cœur
  • 37,241
  • 25
  • 195
  • 267
cristiano
  • 1
  • 2
  • What you want should not be possible. In general, there is no way, outside of security/privacy bugs, for one app to determine when another app is doing specific things, such as using the camera. – CommonsWare May 04 '15 at 12:29
  • Logical answer, but if its very possible and simple to detect any change in the device by Broadcast Receiver why its very hard "if we don't wants to say impossible", to detect the application name that is responsible of this change?? note: my device is rooted and my application is installed as system application. – cristiano May 04 '15 at 12:40
  • Simple: you cannot "detect any change in the device by Broadcast Receiver". In fact, there are very few changes that result in broadcast `Intents`. – CommonsWare May 04 '15 at 12:42

1 Answers1

0

You could check the job queue from your BroadcastReceiver and see what is the current app.

related topic

Community
  • 1
  • 1