Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run application in background in android?

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).

like image 379
user915508 Avatar asked Aug 27 '11 13:08

user915508


2 Answers

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.

like image 198
CommonsWare Avatar answered Oct 19 '22 12:10

CommonsWare


Use FileObserver to detect file access or change.

like image 36
Peter Knego Avatar answered Oct 19 '22 12:10

Peter Knego