1

what is the difference between both , which to use when any idea and which is the best to keep track of a directory change like delete file moved file?

Alex Boro
  • 31
  • 2
  • Well, WatchService doesn't exist until API version 26. So using it on the vast majority of ANdroid devices won't work. – Gabe Sechan Sep 25 '18 at 17:44

1 Answers1

0

FileObserver is Android based while WatchService is Java based. You can use WatchService in Android as well since Android is a robust package of Java. Just as Java Serializable is to Android Parcellable, so is WatchService is to FileObserver. I bet you, Android implementation works best as speed, efficiency and memory consciousness are better taken into account in Android