My app now has a background service that needs to check if there is any changes in some specific directories chosen by users. If there is any new files, it will be uploaded to a server (like syncing to your Dropbox folder), but if the user deletes a file from his device, the file on server will not be deleted. My problem is I can't find an effective way to detect changes.
I first used recursion to check folder size but clearly the performance is not good at all (the service have to recursively check folders after xxx minutes/seconds, record its size to compare to the next time...).
I tried using DownloadManager.ACTION_DOWNLOAD_COMPLETE, which turns out not a good option either. Firstly, new files can be copied, not only downloaded. Secondly, the broadcastreceiver can only receive requests send from my app, not from other apps or browsers). I check around Google and StackOverFlow but can only find how to scan for Media Files, I need more than that. Any suggestions?
Thanks in advanced.