Help with tiny db

I have the following blocks… but they don’t work…Screenshot (21) Screenshot (22)

First, show your error message if you have one, second, TDB does not accept booleans as variables I think.

It can be attached into the tag socket, yes I know, but I think however this is causing the error.

Wrong.

So to help people in the community we have to be wizards and read your mind, while you are putting 0 effort at all. Please post the error you are getting.

1 Like

No error message, just does not work. The doc said tinydb uses “ANY” as value… Mistake?

Off-topic:

Yeah I didn’t really know it. Sry.

1 Like

So then what is the problem? What are you trying to accomplish?

1 Like

Store True/False for the three switches in the tinydb. Read them back after re-initiate the app, then reset the three switches accordingly. That’s it.

The problem is the switches did not reset after reboot the app.

And what doesn’t work?

Also, right click on blocks and press do it.

1 Like

After clicking Do It, nothing happens. No error. No reaction. What suppose to surface?

Thanks.

Alright, have you checked your logic?

20200504_210022

You don’t need “if, then, else” there, just connect "is Checked " to value to store.
20200504_210421

3 Likes

Not sure “reset companion screen” reload the test app. If it is, then the tinydb implemention is workiing.

But when I exported into an apk. It does not work. Thank you Dev_YB for your input. I checked with Snackbar. by using switch1 isChecked, it also stores “true”.

Now just have to figure out, why the apk does not work. Is it possible, there is some setting in the mobile device needs to be setup?

I used the SnackBar to view the TinyDb. It does store and retrieve correctly. Yet only in test mode, not in apk mode.

I don’t know if you use Google Drive.

In this post in the App Inventor Community, a user had a similar problem with TinyDB, .apk, and Google Drive.

2 Likes

Thank you for the mobile tip. I checked and found out that my apk was not allowed to “store” on my mobile. So I enabled “storage” for my apk.

Unfortunately, it still did not solve it. While “Refresh Companion Screen” worked nicely.

Any other idea? Much obliged.

Dont store true/false in tiny db it will not work, instead of that store two different texts like “true” for true and “false” for false.

Tiny db can store text value but not true false blocks.

Are you sure?
:slightly_smiling_face:

2 Likes

Well, since I am stuck. I am willing to try anythinng. Unfortunately, after I implemented the following, the result is still the same. It worked nicely in “Refresh Companion” but not in apk. HELP!!!

I think so.

image

Try This way. If it worked, Mark as solutiomn

Method attempt 1–

Method attempt 2–

Method attempt 3–

Method attempt 4–

i have tried all the above method and all the method worked properly.

and now we say say that tinydb also stores bollean.