Note also that your application must be running in order to get
notified by the fileobserver.
If the directory get changed while your app is down it won't get
notified.
You may consider to use a service or save the state of the directory
in "onPause" method and compare it in "onResume". It depends on what
you need to do with these changes.
Hope this helps,
Federico
On 12 Lug, 06:05, perumal316 <[email protected]> wrote:
> Hi,
>
> I tried using FileObserver but I am having problems importing
> "android.os.FileObserver"
>
> But I am getting the following error:
>
> "The import conflicts with a type defined in the same file"
>
> Any idea how to resolve this?
>
> Thanks In Advance,
> Perumal
>
> On Jul 12, 11:29 am, Romain Guy <[email protected]> wrote:
>
> > To monitor files and directories, you can simply use a
> > FileObserver:http://d.android.com/reference/android/os/FileObserver.html
>
> > On Sun, Jul 11, 2010 at 8:25 PM, perumal316 <[email protected]> wrote:
> > > Hi All,
>
> > > Is it possible to do polling in Android?
>
> > > For example, I want my application to monitor a directory
> > > continuously. If there is for example a new folder created in that
> > > directory I want to log it down.
>
> > > Is it possible to acheive this by polling? Or is there any other way
> > > to do this?
>
> > > Thanks in Advance,
> > > Perumal
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Romain Guy
> > Android framework engineer
> > [email protected]
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support. All such questions should be posted on
> > public forums, where I and others can see and answer them- Hide quoted text
> > -
>
> > - Show quoted text -
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en