Need help! How to save and display book title and author to listview in bookmark page

Hello guys. I am new to App inventor and I'm making a project about book search app.

Although I've finished the search page part, I don't know how to save a book title and author by clicking "Bookmark It!" button on Search page, store it in TinyDB (I named it BooksDB) then display book title and author to Listview in Bookmark page.

Here's the SearchPage screen(ran from Emulator) with block:

And here's the Bookmark page screen with the blocks I'm still working on:

The BookmarkBTN (found in search page screen) im still working on but I don't know how to implement it further.

Here's the copy in case if you want to check
Book_search_app_copy_2_copy.aia (1.1 MB)


Very briefly - don't use a tag called "books". The tag could be the book title (no space characters allowed) and the value could be either just the Name of the Author or both the Name Of the Author and the Book Title.

You can rename TinyDb but don't name anything and overwrite the system name - if you do that, nobody trying to read your code will understand it. GUI Layout

To make a List for a List View from Tiny Db:

How to store the bookmarks - as I described above, but where will your App collect the Book Title and Author from? We only go through an entire Project to help as a last resort given that we have so many people to help.

I will try the one you made above.

Not sure what you meant by collect but I am using Google Books API to get book's info (title, author, etc.). Is it possible to save book title and author to listview?

Using Tiny Db And Dictionaries

Welcome Janjan.

This is simple code . Store the data to a List, store the List to the TinyDB ...

In practice you need additional code to reload the BookMark List on screen unitization to the ListView; provide code to avoid duplicates etc. The example ignores your Bookmark page. You really do not need at that :cry: code.

Nice project. :slight_smile:

I'll try to attempt that code and see if it works. Thank you so much :relaxed:

Thank you so much for the help. It works. I have a question: How do I put the author's name on the next line after the book title?


Author: Marie Lu

You can convert the BookMark List to a listOfPairs (BookMark2) as one way to place the author under the Title (or save the Title/Author data in that format in the BookMark List instead if the way it is done now)


The above example shows how to convert BookMark to BookMark2 and display the title/author in a ListView. It also shows how you might display the information in a Label.

Use a similar construction elsewhere in your app. You can save the data in the TinyDB as a list of pairs instead of as a simple List.

Is this what you want to do janjan?

Hello. I tried the second code you made but it didn't work on my part.

However, I tried the first code you showed to me and I made a small change in it based on the 2nd code and it works

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.