Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 722
user1406716 Avatar asked Oct 25 '15 21:10

user1406716


1 Answers

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).

like image 61
CommonsWare Avatar answered Sep 18 '22 06:09

CommonsWare