Questions tagged [fileobserver]

A simple abstract class developers can use to detect changes to a directory (nonrecursively) and fire callbacks as a result.

Monitors files (using inotify) to fire an event after files are accessed or changed by any process on the device (including this one). FileObserver is an abstract class; subclasses must implement the event handler onEvent(int, String).

Full Documentation Link: http://developer.android.com/reference/android/os/FileObserver.html

130 questions
1
vote
3 answers

Smart way of uploading files based on changes

My app has to watch for file changes to a directory and upload a copy whenever a change is made. To do this, I've employed the use of a FileObserver. I have it upload on Creation, Move To, Close Write, and Modify. The problem lies with modify.…
Osmium USA
  • 1,751
  • 19
  • 37
1
vote
1 answer

Fileobserver in service during standby

i've got a problem with my Android FileObserver. I have a background service running (returns START_STICKY), which references two FileObservers. Everything is working fine until the device is set to sleep mode, which will stop the service, as far as…
user2226184
  • 23
  • 1
  • 5
1
vote
1 answer

FileObserver service combined with UploadToImgur AsyncTask: service stops working after a while (NullPointer), Imgur doesn't return proper response

This is my first Android app, so please do go easy on me. The idea is to detect whenever user puts a photo in /mnt/sdcard and upload that to Imgur and then copy the link to system clipboard. Classes in use I have three classes working in my app.…
Awais Imran
  • 85
  • 2
  • 4
1
vote
0 answers

Controlling Motorola Razr's buttons backlights

I'm trying to develop an application to keep my button's led always on when I turn on the screen. I already get a functioning app for rooted phones by writing a Service and a BroadcastReceiver to be alarmed when screen status changes. My problem now…
1
vote
0 answers

Replicating android gallery view

I am working on a project to replicate android gallery and want to add some information against few media files, that need to create own database for media files information. The issue here is if I save all current existing media path in db then how…
1
vote
2 answers

Android jelly bean sends a CLOSE_WRITE event when a video starts instead of just when finished

My code listens to the DCIM folder, using a FileObserver. All Android versions I used, except 4.1.1, sent only 1 event - when the video was finished taken. I think it's the correct behavior - write continually and close when finished. In 4.1.1…
AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
1
vote
2 answers

File Observer works in Debug Mode, but events won't trigger without debugger

I have a class that works as a recursive fileobserver. What it does is makes a file observer for all of the directories in a parent directory and then starts watching them. I know it works because when in debug mode, it logs all of the file changes…
Osmium USA
  • 1,751
  • 19
  • 37
1
vote
1 answer

How to delete file using file observer in Android?

I am trying to delete file using file Observer. In my code, if any file is pushed into SD card, it fires a create event. On that event I want to delete that file. I am trying the code provided below but I am unable to delete the file because the…
Prashant
  • 17
  • 5
0
votes
0 answers

How can I listen for file deletion events in the file manager and create a backup file Android?

The problem I need to solve is to listen for a file deletion event in the device's file manager and create a backup file to store it in a specific directory. illustrative image I have tried using FileObserver(), but it seems to not work as expected.…
0
votes
0 answers

how to observe file is created or deleted of whatsapp status folder after android 10?

My application is for android 10+ , where i can't use MANAGE_EXTERNAL_STORAGE in specific application, here i have to observe(in background) that file is created or deleted in this folder(don't have path , have folder content URI) , I have already…
0
votes
0 answers

call method on file number in folder change (new file created)

How to detect when new file appears in the folder? I tried FileObserver but it doesn't work with URI and I can only get folder URI with Intent.ACTION_OPEN_DOCUMENT_TREE... My main problem is that I have a function running periodically detecting if…
Keenan
  • 1
0
votes
0 answers

Issue with repeated onEvent calls with FileObserver service

Well, I seem to have the opposite problem of most FileObserver posts! Instead of onEvent never being called, mine is being called about 50 times . . . I must have set something up wrong but I'm running out of ideas. Can anyone see what I might…
Bob Dole
  • 31
  • 3
0
votes
0 answers

AccessDeniedException WatchService android studio

i'm trying to build an app that notices when a file is created. I've used WatchService but when i attempt to "register" there is the following error: W/System.err: java.nio.file.AccessDeniedException: /storage/emulated/0/Wow W/System.err: at…
0
votes
0 answers

FileObserver for Chromebook Downloads directory is never notified

I have an android app running on Chromebooks. I'm using FileObserver to watch a few common directories and notify changes. This is successful in all locations except the downloads directory on my chromebook. Downloads directory on this specific…
Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
0
votes
0 answers

Trying to keep my android multi-threaded FIle Observer Foreground Service alive

First of all, Thank you so much for reading this. Currently, I am trying to build an Android App which monitors entire filesystem activity. Therefore, I am implementing code from this link Backgroundservice is running, but not working…
Kigael Lee
  • 119
  • 1
  • 8
1 2 3
8 9