Android History Bookmark

Android History Bookmark

In Android you can access your Browser history and Bookmarks. For more details about Android Browser check developers site.

In this tutorial we are going to fetch all bookmarks and browser history and show them over ListView.

For fetching Browser data we are going to use Browser.BookmarkColumns. This contains all the columns against Bookmark and History of browser.

VIDEO DEMO

Let’s start with example.

1. Create a new project in Eclipse by navigating to File ⇒ New Android ⇒ Application Project and fill required details. By default my activity is MainActivity.java.

2. To work on Android History and Bookmarks we need a uses permission in Manifest file. This permission in mandatory.

3. Now, create a xml layout contains ListView for displaying bookmarks. I named this layout as activity_main.xml.

4. I am using a custom listview here , so i need a new xml layout i.e. custom_view.xml for custom view. If you are new to Custom ListView you can check its tutorial here.

5. Create  a getter and setter java class naming BookmarkModel.java for Bookmark Listview.

6. Now, create a custom adapter naming Custom_Adapter.java. In this class we inflate a custom layout and set the bookmark title and Url over textview.

7. We are going to use Cursor and Content Resolver to fetch Bookmarks details. And add the details into arrayList.

8. Finally come to MainActivity.java and add the following code. In this class we fetch the bookmark history and add the Bookmark Title and Bookmark URL to arrayList and set over listview.

9. Now, you are all done, run your app and you will get the output as shown in video.

Thanks. :)

Download Source Code – >

Leave a Comment

Comment (required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Name (required)
Email (required)