User7723337 User7723337 -3 years ago 120
Android Question

How to use FileObserver for System files [Android]

I wan to monitor changes in android system file

"/sys/class/net/eth0/operstate"
for monitoring ethernet state.

I have written an File Observer class but i am not getting any events in
public void onEvent(int event, String path)
call back function.

Do we need any special type of permissions for observing android system files?

Do i need to run my APK as root.

Thanks.

Answer Source

We can't use for observing Android system files, we need root permissions for this.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download