Android Question [Solved] FileObserver not fire event after take photo with camera.

jsanchezc

Member
Licensed User
Longtime User
Hello,
I install and test FileObserver.
https://www.b4x.com/android/forum/threads/fileobserver.16709/

I did a service running in background to register at internal SQLite database new files at ../DCIM/Camera
It fire events when i access, create, move.... files with file manager.

Problem:
If I take a photo with device camera (native Android app) no event is fired.
Camera let pictures at ../DCIM/Camera

But if I use filemanager to copy or move that photo inside same folder, then event is fired.

Project:
Register at SQLite new photos and send new photos by FTP when wireless avaible.

There is a way to get events from this action?
There is other way to get event when user take a photo with native Android camera app?
Thanks ,
Jose
 
Last edited:

jsanchezc

Member
Licensed User
Longtime User
Thanks Erel, i'll replace fileobserver, i'll create a sub to explore folder and compare datetime of files.
Thanks!
 
Upvote 0

jsanchezc

Member
Licensed User
Longtime User
Hi,
After do some test, i found FileObserver works ok, i had a confusion:
Camera was configured to save photos at SD folder /DCIM/Camera
FileObserver was configured to watch file.DirExternalRoot & "/DCIM/Camera"
Both folders exists but are not the same folder.

After verify that file.DirExternalRoot & "/DCIM/Camera" is not the same path than SD folder /DCIM/Camera,
i configure camera to save photos into file.DirExternalRoot & "/DCIM/Camera"

Now FileObserver fire events when i take photo with camera native app and works ok.

So now i can configure app to react immediately or send at x minutes interval.:)
 
Upvote 0
Top