Question

So my Question is to know if ContentObserver can be used to Monitor a Folder and get Notified when a file is Created/Removed ?

in my Case , i want to Monitor the Camera Folder and get Notified when a new file is Created (Picture Taken) ,

Thanks .

Was it helpful?

Solution

So my Question is to know if ContentObserver can be used to Monitor a Folder and get Notified when a file is Created/Removed ?

No.

in my Case , i want to Monitor the Camera Folder and get Notified when a new file is Created (Picture Taken)

You can either use a ContentObserver with MediaStore to find out when any images are added or removed, or you can use FileObserver to monitor the standard path to pictures on external storage.

Neither of these will necessarily reflect "Picture Taken", as camera apps do not have to store their images in that specific folder, nor do they have to have their images indexed by MediaStore.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top