Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: CBXE8 - How to detect or receive file access events in Android ?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Sep 8, 2015 10:00 PM Last Post By: Remy Lebeau (Te...
GAI CHEW KAI

Posts: 117
Registered: 7/25/14
CBXE8 - How to detect or receive file access events in Android ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2015 8:25 PM
Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.
Window 10 Pro x64
Android 4.1.2

QUESTIONS

1. Is there ways to register and receive file access events such as file creation, deletion, ...etc in Android ?

Please advise.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: CBXE8 - How to detect or receive file access events in Android ? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2015 10:00 PM   in response to: GAI CHEW KAI in response to: GAI CHEW KAI
GAI wrote:

Is there ways to register and receive file access events such
as file creation, deletion, ...etc in Android ?

Android has a FileObserver class for that purpose:

http://developer.android.com/reference/android/os/FileObserver.html

You would have to derive a class from FileObserver and override the abstract
onEvent() method to act on the file events you ask for in the class constructor.

Note that you can only monitor a specific file or folder, you cannot monitor
the whole system. And I have no idea how/if you can implement this using
Delphi/C++Builder FireMonkey.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02