1 of 16

What is TinyDb?

2 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.

3 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.
  • It stores data permanently on the device.

4 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.
  • It stores data permanently on the device.
  • It doesn’t purport to be a full feature Db

5 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.
  • It stores data permanently on the device.
  • It doesn’t purport to be a full feature Db
    • Like SQLite (Android’s Db) or MySQL.

6 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.
  • It stores data permanently on the device.
  • It doesn’t purport to be a full feature Db
    • Like SQLite (Android’s Db) or MySQL.
  • Data are stored in tag/value pairs.

7 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.
  • It stores data permanently on the device.
  • It doesn’t purport to be a full feature Db
    • Like SQLite (Android’s Db) or MySQL.
  • Data are stored in tag/value pairs.
    • Tag must be a string.

8 of 16

What is TinyDb?

  • TinyDb is App Inventor’s database.
  • It stores data permanently on the device.
  • It doesn’t purport to be a full feature Db
    • Like SQLite (Android’s Db) or MySQL.
  • Data are stored in tag/value pairs.
    • Tag must be a string.
    • Associated value may be a number, string, or list.

9 of 16

Values are stored and retrieved by their tag

Tags

Values

NAME

ralph

ralph

store

retrieve

Notice the default value,

10 of 16

Values are stored and retrieved by their tag

Tags

Values

NAME

ralph

SCORE

90

90

store

retrieve

Notice the default value,

11 of 16

Values are stored and retrieved by their tag

Tags

Values

NAME

ralph

SCORE

90

MY_LIST

[“Apple”, “Banana”, “Cucumber”]

[“Apple”, “Banana”, “Cucumber”]

store

retrieve

Notice the default value,

12 of 16

Add a TinyDb

TinyDb is App Inventor’s Db for storing data permanently on the device.

13 of 16

Add a TinyDb

TinyDb is App Inventor’s Db for storing data permanently on the device.

14 of 16

Add the entire list to TinyDb

Whenever a new picture is taken.

15 of 16

Restore the list from the TinyDb

When the app starts up.

We use the

Screen.Initialize

block for this.

16 of 16

Q/A: TinyDb/Permanent Storage