facebook

Bookmark function

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #351658 Reply

    Philip!!!
    Member

    Hi octavio.

    I would like to add in my book application a bookmark option
    so i can save the current page am reading.
    (perhaps in another screen called “my bookmarks”)

    how can i implement something like that?

    #351681 Reply

    Code_A
    Member

    Easiest solution for your situation may be to save the bookmarks to localStorage, maybe using an array or csv type format (book id, page#). Assuming you want to be able to save multiple bookmarks.

    Search the forums for localStorage if you are unsure how to implement. There are plenty of examples, like CincyPlanet’s in the how-to forum.

    #351683 Reply

    Philip!!!
    Member

    I didn’t find something that helped me.

    #351694 Reply

    Philip!!!
    Member

    Hi Octavio

    Any tips?

    #351717 Reply

    Philip!!!
    Member

    Hi Octavio

    Any ideas on how to implement a bookmark function?

    save my current page in a screen, and be able to save multiple Bookmarks?

    #351734 Reply

    Code_A
    Member

    How are your app screens setup? Do you have multiple screens? Are you using a multipage widget? Are you loading your screen content dynamically from a server? This information is needed to provide you direction on how to save the page.

    You can use localStorage to do this. It may be as simple as saving the screen name or the multipage page name as the bookmark.

    Can you post an example?

    #351741 Reply

    Philip!!!
    Member

    Hi code A

    In most of my app i am using multipage widgets but also a part of it has multiple screens.

    I am not using a server. everything is in the apk file if this is the information you need , so i think the answer is static loading.

    i can not post an example here, but if it is necessary i can send you one in privet somehow.

    #351759 Reply

    Code_A
    Member

    To save a multipage screen name to localStorage, try this:

    var activePage = $(newPage).attr('id');  //you can also use oldPage here if you want to know the previous page
    localStorage.setItem('bookmark',activePage);
    

    To load a multipage screen from localStorage, try this:

    var bookmark = localStorage.getItem('bookmark');
    phoneui.gotoMultiPagePage('m1-<your-file-name>-multiPage1', 'SET_PAGE', ' + bookmark +', 'FADE');

    I have not tested this code. Just pieced it together real quick to give you an idea of how it’s done. Hopefully this helps to get you started.

    #351767 Reply

    Hi philip,

    I shared an small example with you, which I think also will be helpful for this functionality.

    #351811 Reply

    Philip!!!
    Member

    Hi Octavio.

    The example you post , it regards another topic which it helped by the way.

    Here i am trying to implement a bookmark function, i am trying to find a
    way to save a page or screen and have them all displayed (maybe like a link??)in one screen which i am gonna call “my bookmarks”

    #351813 Reply

    Code_A
    Member

    You can use a list widget to dynamically display all your saved bookmarks.

    #351819 Reply

    Agree with Code A. You can find an example about it here: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=6217
    Note that customizing to fit your requirements needs proficient skills with javascript and websql.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Bookmark function

You must be logged in to post in the forum log in