1

I am newbie in android. I want to register receiver when phone Contacts Database is accessed i.e when any app is reading phone contacts, my receiver is called.

I know about ContentObserver but it is called when data is changed. However I want to get notification when contacts database is accessed i.e reading contacts only.

Any help (code/example) would really appreciated.

Thanks

Sam
  • 423
  • 2
  • 9
  • 23
  • You could make use of a FileObserver and catch read events in the onEvent but I'm not sure whether you are allowed direct access to contact db files. Also, the location would probably differ from phone to phone. – AndyFaizan Mar 15 '14 at 17:04
  • I want to get notification when phone contacts are read by another application runtime? How can I do that? – Sam Mar 15 '14 at 17:40
  • The FileObserver can give events involving the particular file or folder accessed/modified by any process on the device but, as I said earlier, I'm not sure whether the db will be directly accessible. – AndyFaizan Mar 15 '14 at 17:43
  • It's not working with DB. Any other way to it? – Sam Mar 16 '14 at 06:46
  • How about this? http://stackoverflow.com/questions/17443122/how-can-i-monitor-another-applications-database-for-changes – AndyFaizan Mar 16 '14 at 06:58
  • My app don't have root access. Didn't find a workable solution – Sam Mar 16 '14 at 07:45

0 Answers0