How to continue using Browser Bookmark Changes in Android 6.0 (API 23)

让人想犯罪 __ 提交于 2019-12-18 12:35:59

问题


In my app, I have been using some of these function that are coming up as unknown when using Android 6.0 (buildToolsVersion "23.0.1"), the functions are: Browser.getAllVisitedUrls(getContentResolver());, BookmarkColumns.URL, etc.

How can I use the same functions going forward with Android 6.0.

In the list of things that have changed in Android 6.0, I see the following:

Browser Bookmark Changes

This release removes support for global bookmarks. The android.provider.Browser.getAllBookmarks() and android.provider.Browser.saveBookmark() methods are now removed. Likewise, the READ_HISTORY_BOOKMARKS and WRITE_HISTORY_BOOKMARKS permissions are removed. If your app targets Android 6.0 (API level 23) or higher, don't access bookmarks from the global provider or use the bookmark permissions. Instead, your app should store bookmarks data internally.

What does this exactly mean? **Instead, your app should store bookmarks data internally**???

I was accessing the history of websites (with explicit user permission of course) visited using the Chrome Browser app, how to continue doing that?


回答1:


How can I use the same functions going forward with Android 6.0.

You can't, in terms of the Android SDK.

What does this exactly mean? "Instead, your app should store bookmarks data internally"???

If you were using the bookmarks provider for storing your own bookmarks (e.g., you wrote your own Web browser), store your bookmarks in your own data store (e.g., a SQLite database).

(and, ideally, write some code to do that now, and ship it, so users whose devices are upgrading to Android 6.0 are not locked out of the bookmarks you put into the Bookmarks provider)

so this means that getting Browser history of Chrome app is not possible?

At least not through the Android SDK's Browser provider. I have no idea if the Chrome team is exposing the browser history through some other documented and supported public API. The same holds true for any other Android Web browser (e.g., Firefox).



来源:https://stackoverflow.com/questions/33335175/how-to-continue-using-browser-bookmark-changes-in-android-6-0-api-23

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