Change the way Android Browser sort its Bookmarks programmatically -


I am writing a bookmark manager app, and when I tried to use bookmarks, Default browser with provider).

I know that I can query the browser content provider and I can use the data as please (title + "ASC", .VISITS + "DESC", etc.) but It's not just the bookmarks list shown on my app and the actual bookmark shown on the Android browser.

There are many such apps that are sorting the browser bookmark (like bookmark sorting) in the market, for example "bookmark sorting and backup" I know that this is possible.

Is anyone able to give me some direction on how this is possible? A line of code, a tutorial?

Update - Optional solution:

Android sorts its bookmarks based on a special column! The database is located in database "Data -> Data -> com.android.browser -> Database -> Browser .db" from the database. You can use root explorer like ADB to get here.

Android 2.2 has changed its bookmarks according to the "Visits" column, so the most frequently viewed bookmarks will be kept before and so on.

If you want to change sort order, you will need to update the "Visit" column for each bookmark. For example: If you want to sort bookmarks alphabetically, then you have to update the "Visits" column in such a way that the "visits" in the bookmarks that begin with the letter "A" will be the highest value. Android Bookmarks will get 1,000 visits, visiting BestBoy.com Book 900 and so on.

Things to consider:

  • The total amount of bookmarks (so that you can set the highest "visit" value, first in bookmarks And subtract it from at least 1 visit for other bookmarks).
  • The Android Browser is constantly increasing every time a user enters the website, there is a "Visit" number since you can not predict how many times a user will click on a certain bookmark and on their app To keep the selected user order sort order - You need to make sure that the "Visit" value is the "Visit" value bookmark number 2 compared to bookmark number 1 (m Does suggest at least 1000 differences).

On the previous Android version, sorted according to the "created" column. For example here:

I hope this will help someone;)

If you have different ideas / solutions, please share!

OK I have found a solution for this. This is not a solution, but more of a hack but you can retrieve the current bookmark data, sort it, remove all bookmarks, and insert them into a new order sequence.

Another option is to update creation date / time. For example here:

In addition, it seems that the default browser on Android 2.2 is the most frequently viewed bookmarks, so you have to change this column.

I hope this will be helpful to anyone ...

If you have different ideas / solutions, then please share :)

Update:

It has changed since Android 3.0 and above. The Bookmakers database is now a "Status" column that you can change to sort bookmarks.


Comments