9

Hi, I want to make an Android application that continues to run in background and when user accesses any folder, picture, or any other file it notifies using toasts that he accesses this file(filename).

Nikolai Samteladze
  • 7,699
  • 6
  • 44
  • 70
user915508
  • 91
  • 1
  • 1
  • 3
  • 1
    You can do that by using Services in Android. Here is a nice tutorial for doing that. [Services](http://marakana.com/forums/android/examples/60.html) Also you can download a sample from my [respository](https://github.com/lalit3686/ServiceLifeCycle). – Lalit Poptani Aug 27 '11 at 13:30

2 Answers2

3

The other people answering your question are focused on the "background" part, and a Service would indeed accomplish this. Users have fairly loudly stated that they despise constantly-running services like the one you are proposing.

when user access any folder or picture or any file it notify using tosts that he acess this file(filename).

For files that you can access yourself (e.g., those on external storage), you can use FileObserver class.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

Use FileObserver to detect file access or change.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154