Read browser history in Marshmallow And Nougat Android

本秂侑毒 提交于 2019-12-25 08:39:44

问题


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:


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



来源:https://stackoverflow.com/questions/41444771/read-browser-history-in-marshmallow-and-nougat-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!