Read browser history in Marshmallow And Nougat Android

2.4k views Asked by At

I am trying to use Android Browser.BOOKMARKS_URI in Android Marshmallow. Until Lollipop, there is a way to read the history from the Chrome Browser using the permission. But in Marshmallow the permission is removed. Does any other alternative available for reading the browser history on a Marshmallow device?

I referred This Official Android Documentation, But not get a clear idea.

Thanks.

1

There are 1 answers

1
Akarsh Agrawal On

Due to security reason the browser history read/write are now not accessible by to the app. This step was taken by Google after API >= 23.

query() calls hasReadAccess(), which calls hasPermission("com.android.browser.permission.READ_HISTORY_BOOKMARKS"), which on API >= M ignores the permission argument and instead checks for com.android.chrome.permission.READ_WRITE_BOOKMARK_FOLDERS. This permission is limited to system apps and apps signed with Google's key.

https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser