Using TinyDB in App Inventor

You may also like...

27 Responses

  1. Bethany Plumpton says:

    This is a great guide, now I know how to use a TinyDB

  2. Michael Beacham says:

    Hi, my name is Michael. Recently I started using App Inventor 2 to make some nice ‘adult’ apps. This is a great tutorial on how to use a TinyDB, as I require one for all the data being stored. Lol. Thanks.

  3. Rage Nln says:

    Awesome guide! I just started trying to make apps on App Inventor 2 and I wasn’t sure how to use TinyDB until I read this!

  4. nate says:

    i have no idea what i’m doing my partner in cse is forcing me to do this i’m a freshmen and right now i’m in hell

    • Edward M says:

      Is there a question there? Are you just starting using App Inventor or do you have some experience and you are trying to use TinyDB?


  5. matt says:

    Is it ok for me to use this source code for a class I’m in? It would be great for me and my partner!!

    • Edward M says:

      Of course – all the code I post is intended for sharing and especially for learning – if possible, please give credit to this web site, just like citing a reference in a written paper.


  6. Maynard C. Bicos says:

    is there any way to access the content of the tiny db? as an i have the rights right? i was supposed yo do is there is registration from and as an admin i want to see those who access my android app. hope you will answer this Thank you!

  7. miako girre says:

    Hello, I have a question for the list. How do we make a list with item that opens a new screen when it is selected ?
    thank you

    • Edward M says:

      With some code … when the list item is selected, you need to call the open another screen block. The open another screen item is locaed in Palette | Control blocks section in the Blocks editor.

      I have a whole chapter on using open another screen and related issues, like passing a value to and from the sub screen, in Volume 1 of my App Inventor e-book tutorial.


  8. Kleyton Klaus says:

    I would like first to commend you for the excellent work and take a big question , I’m developing a project that will have a database with aproximadamento 1000 lines . Would I like to feed that data into a text file , csv , xls , any form and use the data for each column differently. But I do not know how. Database with MySQL would the ratio for primary keys with two tables would make a while or is to take the data of each field , armazenaira in a variable and manipulate the schedule.

    In APPInverntor , how can I do this with your native database ?

    • Edward M says:

      As it sounds like you are familiar with MySQL and have ideas how to set up the MySQL database, I would recommend using Google Fusion tables. App Inventor does not, at this time, support MySQL. Instead, App Inventor supports a SQL-like database called “Fusion Tables” and they have launched a new feature in “experimental” mode, called Firebase DB.

      Fusion tables are somewhat complex to set up (you have to login in to a Google developer’s console to create your Fusion table, set up various linkages) and then write special App Inventor code to link to the Fusion table.

      This is fairly complicated and is why I have not tried to explain it online. I have a huge write up on this in Chapters 12 and 13 of my App Inventor 2: Databases and Files book. You can learn more about the e-books on this page:

      The book also covers the use of text files for writing and reading, plus the use of CSV format files in App Inventor.


      I hope that is useful to you and your application.

  9. Rachita shukla says:

    Can i use tinyDB to update the status of a button in an app to the same app in other phone? if not which component can help me do that! please help

    • Edward M says:

      If I understand your question, you have an app on one phone, say Phone A, and you would like to transfer some information from the app in Phone A to an app in Phone B? In this case, to change the status of an item (a button) between the two phones.

      If I understand that is what you want to do, there are 3 ways you might do this, none of them super simple. FirebaseDB is one way, and perhaps the easiest, although FirebaseDB is still an experimental feature. I have an example using FirebaseDB here –

      Another way would be to keep the status information in another cloud-based database. The easiest one to use is TinyWebDB, but Fusion Tables could also be use. Both require some set up to be done in advance, and there is not a short explanation. However, my ebook goes into a lot of detail of how to use those cloud databases – see

      App Inventor 2 Databases and Files (Volume 3 e-book)
      Step-by-step TinyDB, TinyWebDB, Fusion Tables and Files

      More information on that book is available here


  10. Ravi says:

    Now I understand, how to use TinyDB…
    Thank U Sir.

  11. Ravi says:

    I need your help…
    Its all about numbers logic.
    I want to make a logic. When I type ‘102’ in text box,the app has to print
    ‘1000’ in label. If type’214′ app has to print ‘210000’

    Example for relation : 102 > 10*10^2
    224 > 22*10^4
    337 > 33*10^7 etc

  12. Joshua says:

    What If you want to create a game with options of “Save Game” and “Load Game” ….How do we use the tinyDb component?

  13. alex says:

    Hi what if your trying to save multiple text boxes at once using the one save button how would your blocks look then we are trying to use the date inputed in the date picker as our file name also if you have anything close to this i can look at would be great please thanks

  1. March 31, 2015

    […] earlier blog post described how to store data using TinyDB so that an app’s data can persist between uses of the program, or even to share data between […]

  2. October 30, 2015

    […] You can see the all new rewrite at Using TinyDB in App Inventor […]

  3. October 12, 2016

    […] earlier blog post described how to store data using TinyDB so that an app’s data can persist between uses of the program, or even to share data between […]

  4. November 26, 2016

    […] L'orientation du smartphone est donnée par les valeurs suivantes : Azimuth, Pitch et Roll (azimut, tangage et roulis en français) La programmation va se faire en plusieurs temps: App Inventor : exemples d'IHM Android pour carte Arduino – éduscol STI. Tutorials for App Inventor. Using TinyDB in App Inventor – App Inventor 2 – Learn to Code! […]

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress spam blocked by CleanTalk.
LinkedIn Auto Publish Powered By :