tag:blogger.com,1999:blog-1089315940126984688.post1033322046956737483..comments2023-12-26T00:53:13.035-08:00Comments on Android Bridge: Recursive (Sub directory) File System Watcher in Android.Aruna Tennakoonhttp://www.blogger.com/profile/13691654998632008962noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-1089315940126984688.post-75251485158599023302016-04-05T02:03:41.449-07:002016-04-05T02:03:41.449-07:00Can we keep observer running all the time in backg...Can we keep observer running all the time in background using a service classAnonymoushttps://www.blogger.com/profile/09835883282175073910noreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-72148067479140070132012-12-04T06:16:04.081-08:002012-12-04T06:16:04.081-08:00Your code does not compile without changes, even t...Your code does not compile without changes, even though some commenters already pointed those problems out.<br /><br />Then, the switch block does not work either, because the event is not coming in a clean form, something like "if ((event & CREATE) != 0)" is needed instead.<br /><br />Thanks for the basic idea, it would be great if it worked out of the box!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-90231393855443734342012-10-02T07:32:47.021-07:002012-10-02T07:32:47.021-07:00Would also suggest using the listFiles call that t...Would also suggest using the listFiles call that takes a FileFilter parameter as it excludes the . and .. for you. If you have the filter only accept directories then the array returned will be just the subdirectories.<br /><br />Also Stack class is usually a wrong choice as it is synchronized because it is a subclass of Vector (it really should be deprecated). ArrayDeque or LinkedList would probably be a better choice.dalewkinghttps://www.blogger.com/profile/08300031429025278242noreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-47634409112435493062012-10-02T07:18:23.890-07:002012-10-02T07:18:23.890-07:00One issue with your code is that it should itself ...One issue with your code is that it should itself react to changes to the directory. If a directory gets created it should add an observer to the directory. Likewise if a directory is removed the file observer should be removed.dalewkinghttps://www.blogger.com/profile/08300031429025278242noreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-79956773372536327662012-09-09T01:31:05.030-07:002012-09-09T01:31:05.030-07:00I had tried this example on monitoring the change ...I had tried this example on monitoring the change of /proc/net/tcp.. But it seems it doesn't work. It's there any suggestion about it?pippenhttps://www.blogger.com/profile/15090035971957164255noreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-4870726519070520452012-08-27T07:01:02.544-07:002012-08-27T07:01:02.544-07:00Did you get the "Type mismatch..." error...Did you get the "Type mismatch..." error when doing this:<br /><br />for (SingleFileObserver sfo: mObservers)<br />{<br />sfo.startWatching();<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-81388347373519137842012-03-23T20:44:59.286-07:002012-03-23T20:44:59.286-07:00Thanks this helps. Too bad Google doesn't car...Thanks this helps. Too bad Google doesn't care too much.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-24516154858115003542012-03-06T14:52:08.074-08:002012-03-06T14:52:08.074-08:00There are some mistakes in your code, List and Sta...There are some mistakes in your code, List and Stack are without classAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-42020347158210048602011-07-04T17:29:09.912-07:002011-07-04T17:29:09.912-07:00tyvm for posting!tyvm for posting!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-29789043030046807902011-06-06T04:24:46.521-07:002011-06-06T04:24:46.521-07:00Looks like they are not going to accept this chang...Looks like they are not going to accept this change because of overheads.Sreedharnoreply@blogger.comtag:blogger.com,1999:blog-1089315940126984688.post-91806335339648022652011-04-22T09:58:01.362-07:002011-04-22T09:58:01.362-07:00I'm glad they fixed it - I recently worked on ...I'm glad they fixed it - I recently worked on an anti-virus project and ended up having to add a FileObserver to every single directory on the device.<br /><br />BarryBarryhttps://www.blogger.com/profile/03428476228181986895noreply@blogger.com