Android Question Access to Chrome bookmarks and history

ddahan

Member
Licensed User
I'm looking for a way to get access to Chrome bookmarks and surf history (Locally or through Google account).
I'll appreciate your help.
 

ddahan

Member
Licensed User
Hi ,
Erel - Your suggested code is returning a few not changing url's. seems not to be a history.

NJDude - I'm using this code:
B4X:
    Dim ContentResolverObject As ContentResolver
    Dim UriObject As Uri
    UriObject.Parse("content://com.android.chrome.browser/bookmarks")
    ContentResolverObject.Initialize("ContentResolverObject")
    Dim CursorObject As Cursor = ContentResolverObject.Query(UriObject, Null, "", Null, "")
   
    Dim BMCounter As Int 
    BMCounter = 0
   
    If CursorObject.IsInitialized Then
        Dim CursorObjectSize As Int
        CursorObjectSize = CursorObject.RowCount
    Log(" --------------- Bookmarks Sync ----------------")
        For r = 0 To CursorObjectSize - 1
            CursorObject.Position = r
            Try
                Dim URL As String
                URL = CursorObject.GetString2(1)
                Dim Title As String
                Title = CursorObject.GetString2(5)
                Log("Row: " & r & " URL: "  & URL & " , Title: " & Title)
                Log("Bookmark: " & BMCounter  & " / " & CursorObjectSize)
            Catch
            Log(" ----------- Bookmark failed !!! ----------")
            End Try
        Next
      CursorObject.Close
    End If
it seem that it returns a mix of bookmarks and history url's.

I'll appreciate your advice.

thanks,
David.
 
Top