surfuric Member Licensed User Longtime User Oct 29, 2017 #1 I have searched and do not think there is a built in equivalent to Visual Basic's FileSystemWatcher. So I guess I will write a service which poles a directory every 5 minutes and checks for new files, then I can send the files to my ftp site. But there will be thousands of files in the directory and listing them out and checking against a SQL database of known files every 5 minutes will certainly not be efficient. Maybe limit File.ListFiles with File.LastModified in a loop? But that seems a waste of resources also. Any suggestions how to do this and not destroy battery life?
I have searched and do not think there is a built in equivalent to Visual Basic's FileSystemWatcher. So I guess I will write a service which poles a directory every 5 minutes and checks for new files, then I can send the files to my ftp site. But there will be thousands of files in the directory and listing them out and checking against a SQL database of known files every 5 minutes will certainly not be efficient. Maybe limit File.ListFiles with File.LastModified in a loop? But that seems a waste of resources also. Any suggestions how to do this and not destroy battery life?
XbNnX_507 Active Member Licensed User Longtime User Oct 29, 2017 #2 https://www.b4x.com/android/forum/threads/fileobserver.16709/#content Upvote 0