如何获得的Chrome历史和放大器;书签在Android的棉花糖(API> = 23)? [英] How to get Chrome History & Bookmarks in Android Marshmallow (API>=23)?
问题描述
截至API等级22(即至棒棒堂),出现了从Chrome应用程式阅读历史和书签(如图的此线程) com.android.browser.permission.READ_HISTORY_BOOKMARKS
。
Till API Level 22 (i.e. till Lollipop), there has been a way to read History and Bookmarks from the Chrome app (as shown in this thread) using the permission com.android.browser.permission.READ_HISTORY_BOOKMARKS
.
现在,在Android的API = 23棉花糖,因为整个浏览器的书签系统已在棉花糖(被删除<一个href=\"https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser\"相对=nofollow>这里变化),上述方法不工作了。
Now, in Android API=23 Marshmallow, since the entire Browser Bookmark system has been removed in Marshmallow (changes here), the above method does not work anymore.
<一个href=\"http://stackoverflow.com/questions/33335175/how-to-continue-using-browser-bookmark-changes-in-android-6-0-api-23/33335488#33335488\">Here是说明了为什么这是不可能的了线程。
在我的研究,到目前为止,我还没有找到一个好消息。谷歌肯定已经杀死了系统书签功能(的此处&放大器;的此处),问题是,如果在Chrome浏览器会以任何方式被暴露了吗?
In my research so far, I have not found good news. Google has definitely killed the System Bookmarks feature(here & here), question is if Chrome Browser would be exposing it in any manner?
有没有一种替代/方法来读取浏览器书签和历史记录(甚至镀铬具体会回答这个问题)的Android的棉花糖前进?
Is there a replacement / way to read Bookmarks and History from Chrome (even Chrome specific would answer this question) going forward in Android Marshmallow?
推荐答案
您可以给它通过ChromeBrowserProvider一试,因为它是从android.browser不同,但它很可能是,这并不正常工作。
这里有一个例子添加书签:
You could give it a try via the ChromeBrowserProvider, since it is different from android.browser, but it is quite likely that this does not work as well. Here's an example for adding a bookmark:
ContentValues values = new ContentValues();
values.put(Browser.BookmarkColumns.TITLE, "title");
values.put(Browser.BookmarkColumns.URL, "http://ss.com");
values.put(Browser.BookmarkColumns.BOOKMARK, 1);
values.put(Browser.BookmarkColumns.CREATED, 0);
values.put(Browser.BookmarkColumns.DATE, 0);
values.put("parentId", 3); // just for Chrome
getContentResolver().insert(Uri.parse("content://com.android.chrome.ChromeBrowserProvider/bookmarks"), values);
您可以创建这个code的基础上的GET请求。
这里的<一个href=\"https://android.googlesource.com/platform/external/chromium_org/+/f8ee788a64d60abd8f2d742a5fdedde054ecd910/chrome/android/java/src/org/chromium/chrome/browser/ChromeBrowserProvider.java\"相对=nofollow>来源$ C的内容提供商的$ C 。用一粒盐拿去吧,因为它可能是过时的。
You could create a get request on basis of this code. Here's the source code of the content provider. Take it with a grain of salt, since it might be outdated.
这篇关于如何获得的Chrome历史和放大器;书签在Android的棉花糖(API&GT; = 23)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!