Note that there are some explanatory texts on larger screens.

plurals
  1. POChange the way Android Browser sort its Bookmarks programmatically
    primarykey
    data
    text
    <p>I'm writing a Bookmark manager app and I got kinda stuck when trying to resort the Bookmarks (the ones being used by the default Browser with contentProvider).</p> <p>I know I can query the Browser contentProvider and resort the data as I please (.TITLE + " ASC", .VISITS + " DESC", etc) but this will only sort the Bookmarks list shown on my app and not the actual Bookmarks shown on the Android Browser.</p> <p>There are several app which does that (sort the Browser bookmarks) on the Market, "Bookmark sort &amp; backup" for example so I know it's possible.</p> <p>Can anyone PLEASE give me a little direction on how this it possible? a line of code, a tutorial? anything will be appreciated!</p> <p>Thank you, Lior</p> <p><strong>UPDATE - Optional Solution:</strong> </p> <p>Android sort its bookmarks by a specific column from the Bookmarks database. The database is located in "Data -> Data -> com.android.browser -> databases -> browser.db". You can use ADB to get there or apps like Root Explorer.</p> <p>Android 2.2 sorts its Bookmarks according to "visits" column, therefore the most visited Bookmark will be placed first and so on.</p> <p>If you want to alter the sort order, you would have to update the "visits" column of each Bookmark. For example: if you want to sort the Bookmarks Alphabetically you need to update the "visits" column in such a way that Bookmarks starting with the letter "A" will have the highest value of "visits". Android.com Bookmark will get 1000 visits, BestBuy.com Bookmark will get 900 visits and so on.</p> <p><strong>Things to consider:</strong></p> <ul> <li>The total amount of Bookmarks (so you can determine the highest "visits" value, give it to the first Bookmark and subtract at least 1 visit from it for the second Bookmark).</li> <li>The Android Browser continues to increase the "visits" number every time a user enters the website. Because you can't predict how much times a user will click on a certain Bookmark and in order to maintain the sort order the user selected on your app - you must make sure the "visits" value Bookmark number 1 has is much bigger than "visits" value Bookmark number 2 has (I recommend at least 1000 difference).</li> </ul> <p>On previous Android versions, the sort is ordered by the "created" column. see here for example: <a href="http://www.netmite.com/android/mydroid/packages/apps/Browser/src/com/android/browser/BrowserBookmarksAdapter.java" rel="nofollow">http://www.netmite.com/android/mydroid/packages/apps/Browser/src/com/android/browser/BrowserBookmarksAdapter.java</a></p> <p>I hope this helps anyone ;)</p> <p>If you have different ideas/solutions, PLEASE share!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload