Copy file on change - Rooted android device

Rameez Usmani

After reading some links on internet, I started writing my own android app that copies the Viber database file on button click.

Now I want to write code that monitors the Viber db file and whenever any of them changes, it performs some operation like copying it to desired location.

So my main question is how to listen for a change in file that reside in private dir "/data/data/com.viber.voip/"?

Mike Laren

You can use the Android FileObserver class to monitor changes in files and directories.

FileObserver ob = new FileObserver("/data/data/com.viber.voip/") {
   @Override
   public void onEvent(int event, String path) {
     // Do something
   }
}
ob.startWatching();

Check the JavaDocs for more info.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Check if Android device is rooted or not

From Dev

Inverted Screenshot rooted Android device

From Dev

Copy Files and directories with su command on rooted device

From Dev

Copy Files and directories with su command on rooted device

From Dev

set mouse position on rooted android device

From Dev

Changing CPU governor of a rooted android device

From Dev

Android: run a script on non-rooted device

From Dev

Cannot open /data folder in a rooted Android device

From Dev

How to set screen off on a rooted android device?

From Dev

Android: Can we read file from /data/data/ folder using su command in non rooted device

From Dev

Why am I getting Permission Denied when trying to push a Sqlite file to my rooted Android device?

From Java

Android : Capturing HTTP Requests with non-rooted android device

From Dev

Emulate hosts file on non-rooted Android

From Dev

How to read the SMS using shell commands In Rooted android Device?

From Dev

How to hook system calls of my android app (non rooted device)

From Dev

android how to install custom fonts on \system\fonts directory in rooted device

From Dev

Access and manipulate files and directories on an external USB storage in a rooted Android device

From Dev

How to hook system calls of my android app (non rooted device)

From Dev

How to make Android device to go on sleep mode ( say, on button click ), on rooted device

From Dev

Device Owner on Android 5.0 (and others) whitout rooted devices, device provisioning by NFC

From Dev

Android - rooted user - mount: Read-only file system

From Dev

Restricting an application to be installed on a rooted device

From Dev

Install Android system app, silent update without Google play on rooted device.

From Dev

How to install android app in system/app directory without rooted device so that user can not uninstall that app

From Dev

Android ADB stop application command like "force-stop" for non rooted device

From Dev

How to install the apk silently from another application for non rooted device in android

From Dev

Android Device File Path

From Dev

Android: Is android emulator already rooted

From Dev

Can't install APK into rooted device

Related Related

  1. 1

    Check if Android device is rooted or not

  2. 2

    Inverted Screenshot rooted Android device

  3. 3

    Copy Files and directories with su command on rooted device

  4. 4

    Copy Files and directories with su command on rooted device

  5. 5

    set mouse position on rooted android device

  6. 6

    Changing CPU governor of a rooted android device

  7. 7

    Android: run a script on non-rooted device

  8. 8

    Cannot open /data folder in a rooted Android device

  9. 9

    How to set screen off on a rooted android device?

  10. 10

    Android: Can we read file from /data/data/ folder using su command in non rooted device

  11. 11

    Why am I getting Permission Denied when trying to push a Sqlite file to my rooted Android device?

  12. 12

    Android : Capturing HTTP Requests with non-rooted android device

  13. 13

    Emulate hosts file on non-rooted Android

  14. 14

    How to read the SMS using shell commands In Rooted android Device?

  15. 15

    How to hook system calls of my android app (non rooted device)

  16. 16

    android how to install custom fonts on \system\fonts directory in rooted device

  17. 17

    Access and manipulate files and directories on an external USB storage in a rooted Android device

  18. 18

    How to hook system calls of my android app (non rooted device)

  19. 19

    How to make Android device to go on sleep mode ( say, on button click ), on rooted device

  20. 20

    Device Owner on Android 5.0 (and others) whitout rooted devices, device provisioning by NFC

  21. 21

    Android - rooted user - mount: Read-only file system

  22. 22

    Restricting an application to be installed on a rooted device

  23. 23

    Install Android system app, silent update without Google play on rooted device.

  24. 24

    How to install android app in system/app directory without rooted device so that user can not uninstall that app

  25. 25

    Android ADB stop application command like "force-stop" for non rooted device

  26. 26

    How to install the apk silently from another application for non rooted device in android

  27. 27

    Android Device File Path

  28. 28

    Android: Is android emulator already rooted

  29. 29

    Can't install APK into rooted device

HotTag

Archive