Android read browser history
Not really an answer but I can tell you what I did.
I first clone the browser repo and try to reproduce how they get the history.
And I started getting:
Permission Denial: reading
com.android.browser.BrowserProvider
So I added:
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
But it still is giving me the same error. I google it and I found this Accessing Data With Android Cursors.
Hope it helps.
Get browser history and search result in android
For some strange reason, Google decided to mix bookmarks and history calling them "Bookmarks" in the SDK.
Try the following code, the important thing is to filter by "bookmark" type.
String[] proj = new String[] { Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.URL };
String sel = Browser.BookmarkColumns.BOOKMARK + " = 0"; // 0 = history, 1 = bookmark
mCur = this.managedQuery(Browser.BOOKMARKS_URI, proj, sel, null, null);
this.startManagingCursor(mCur);
mCur.moveToFirst();
String title = "";
String url = "";
if (mCur.moveToFirst() && mCur.getCount() > 0) {
while (mCur.isAfterLast() == false && cont) {
title = mCur.getString(mCur.getColumnIndex(Browser.BookmarkColumns.TITLE));
url = mCur.getString(mCur.getColumnIndex(Browser.BookmarkColumns.URL));
// Do something with title and url
mCur.moveToNext();
}
}
Related Topics
How to Get the Md5 Fingerprint from Java's Keytool, Not Only Sha-1
Android - Webview Language Changes Abruptly on Android 7.0 and Above
Scan_Results_Available_Action Return Empty List in Android 6.0
Some Androids Apps Won't Connect Through Fiddler
Android; Check If File Exists Without Creating a New One
Android Get Orientation of a Camera Bitmap? and Rotate Back -90 Degrees
Environment.Getexternalstoragedirectory Does Not Return the Path to the Removable Storage
Losing Data When Rotate Screen
Displaying Emoticons in Android
Firebase (Fcm): Open Activity and Pass Data on Notification Click. Android
How to Use Custom Font with Webview
Dynamic Form with Repeating Form
Disable Activity Slide-In Animation When Launching New Activity
Monodroid: Error When Calling Constructor of Custom View - Twodscrollview
Is There a Listener for When the Webview Displays It's Content