How does an Android app accesses any browser's history? I recently came across FamiSafe, a child monitoring app, through one of my friends which gives a lot of information about the activities of the mobile phone. I was awestruck as it gives a detailed information about the location, browser history, etc.

That got me thinking:


how is it possible for an application to access what websites are visited through a browser? 
How is it possible for this app to know that a person has searched or visited a website and record it and show the same in the application? 
Does this app interact with the OS for website data?


Since it gives data irrespective of browsers I assume it has nothing to do with the browser used. Instead, it has to be something directly to be dealt with. Anyone has any idea how this works?

The device is OnePlus 5 running Android 7.
That app uses Accessibility service (originally meant to assist users with disabilities) to read what is being displayed on the window. It also uses app usage permission to track what app is being used at a time. Combine the two features and the app can know when a web browsing app is active, and what is being typed in there and displayed there. That app has already declared in its description on Play Store that it uses the said service. Under Web Content Filtering &amp; Web Monitoring heading, it states:


  This app uses Accessibility service to limit app usage and keep your children from internet dangers


Related:


How do certain apps record everything we type in android?
Unusual ways of using Android accessibility services (by Maksym Dybarskyi)