Mobile Web

Bookmark: Managing Web Browser Bookmarks

This tutorial demonstrates how you can manage Tizen Web browser bookmarks on the device.

This feature is supported in mobile applications only.

Warm-up

Become familiar with the Bookmark API basics by learning about:

Creating Bookmark Folders and Items

To create engaging applications with bookmark-related features, you must learn how to add bookmark folders and items to the root bookmark folder and subfolders:

  • To add a folder and a bookmark to the root bookmark folder:
    1. Create an instance of the BookmarkFolder interface by specifying the bookmark folder name:

      var folder1 = new tizen.BookmarkFolder("folder1");
      
    2. Create an instance of the BookmarkItem interface by specifying the bookmark item name and URL:

      var tizen = new tizen.BookmarkItem("tizen", "https://www.tizen.org");
    3. Use the add() method of the BookmarkManager interface to add both a bookmark folder and a bookmark to the root bookmark folder:

      tizen.bookmark.add(folder1);
      tizen.bookmark.add(tizen);
      
  • To add a folder and a bookmark to a subfolder:
    1. Create an instance of the BookmarkFolder and BookmarkItem interface:

      var folder2 = new tizen.BookmarkFolder("folder2");
      var developerTizen = new tizen.BookmarkItem("developerTizen", "https://developer.tizen.org");
      
    2. Use the add() method to add a folder and a bookmark to a bookmark subfolder by specifying the parent bookmark folder name:

      tizen.bookmark.add(folder2, folder1);
      tizen.bookmark.add(developerTizen, folder1);
      

      As a result of the code snippet above, the folder1 folder contains the developerTizen bookmark and the folder2 subfolder.

Deleting Bookmarks

To create engaging applications with bookmark-related features, you must learn how to delete bookmarks:

  1. To remove a bookmark item, use the remove() method of the BookmarkManager interface and specify the bookmark item:

    tizen.bookmark.remove(tizen);
    
  2. To remove a bookmark folder, use the remove() method and specify the bookmark folder:

    tizen.bookmark.remove(folder2);
  3. To remove all the bookmark folders and items from the bookmarks list, use the remove() method without specifying a parameter:

    tizen.bookmark.remove();
    

Retrieving the Bookmark List

To create engaging applications with bookmark-related features, you must learn how to retrieve the bookmarks:

  1. To retrieve bookmarks only from the root bookmark folder, use the get() method of the BookmarkManager interface without specifying any parameter:

    tizen.bookmark.get();
    
  2. To retrieve bookmarks from the root bookmark folder and subfolders, use the get() method and set the recursive parameter as true:

    tizen.bookmark.get(null, true);
  3. To retrieve bookmarks only from a specific bookmark folder excluding its subfolders, use the get() method and specify the bookmark folder name:

    tizen.bookmark.get(folder1);
    
  4. To retrieve bookmarks from a specific bookmark folder and its subfolders, use the get() method, specifying the bookmark folder name and setting the recursive parameter as true:

    tizen.bookmark.get(folder1, true);
    
Go to top