Is it possible to get notification when the content of a regular file is changed

Discussion in 'Application Development' started by websurf, Mar 13, 2009.

  1. websurf

    websurf New Member
    5

    Mar 13, 2009
    3
    0
    5
    As the title, when the content of any regular file is changed, is it possible to get notification?

    Thanks.
     

    Advertisement

  2. deepdroid

    deepdroid Member
    15

    Feb 27, 2009
    15
    0
    15
    I think you are looking for android.os.FileObserver.
    You implement a subclass of it, which implements onEvent().
    Then you construct a new instance of this class with the file path and maybe flags as parameters. After calling startWatching() your callback should be invoked with file changes.

    --
    deepdroid
     
  3. websurf

    websurf New Member
    5

    Mar 13, 2009
    3
    0
    5
    Thanks for you replay, I ever tried FileObserver, it only can monitor the registered file or files just under the registered path, But I want to monitor the files under the registered path RECUSIVELY.
     

Share This Page

Loading...