Help with tiny db

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.

No it does.
TinyDB stores in object format so it can store anything.
This is for you:
http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB.StoreValue

Try this and see what happens:

1 Like

Thank you, indianplans. Same. works in “refresh companion” but not in apk. Sorry to disappoint your solution try. :slight_smile:

1 Like

i have tried all in apk version and every condition worked fine.

You need to do one thing. First the uninstall the app. then install the app again. Why because the values are already stored in Tindy DB

Or do one thing

Create a temporary button and use the Clear All tags procedure in Tiny DB

2 Likes

but value of same tag changes when switch checked is changed .
Mean value is refreshing there.

Dear Niksdreamer2001, Thank you for takiing such an effort to prove a point. I too have tried them all. Unfortunately, they all work in “refresh the companion” , but not in my apk.

I have a new Pixel 4 XL. Haven’t master it fully yet. I also tried on a Xiaomi 8. Both do not work.

It’s getting late in California. I am going to hit the sack. Sleep over it until tomorrow.

Thank you everyone for your support.

Good night.

Good night @Donald_Hwong.
By the way its Good morning here :rofl: :joy: :rofl: :joy:

THIS is the solution.

What is the point of set Switch1.Checked to Is checked???
552b1574300e1d39bbedce2580a6c4c1145e5f8b

Yes it just checks if a switch was touched, then if it was on, it sets the checked property of the switch to on, if it was off, it “changes” to off.

If this is, what he wants, it just does nothing with the switch.

If he wants to switch it to the other side when clicked, then he sould prbably set Switch1.Checked to not is Checked. Should work.

Hello @Donald_Hwong

Can you download and install below apk and check if it is working for you or not?

TinyDB.apk (4.7 MB)

Steps I performed to check :point_down:

  1. Open the app.
  2. Turn ON the switch.
  3. Close the app(even from stack if possible).
  4. Open the app again. The Switch should turn ON automatically.
  5. Turn OFF the switch and close the app.
  6. Open the app and the switch should remain OFF

Let me know the result. If everything goes as expected, I will share the blocks here.

2 Likes

everything is correct.and done what we expected

Vaibhav. Your apk worked on nicely my mobile. The strangest thing was it did not even register in my “app permission manager requiring memory storage”.

I tried the following blocks. They also worked flawlessly on my mobile without being registered in the “app permission for storage manager”. Any idea of what’s going on?

I am happy to know that the apk I gave is working :slightly_smiling_face:
So as I told earlier below are the blocks behind the apk I uploaded

blocks (46)

Also after some tweaks I was able to block it in another way :point_down: , which also seems to be working fine for me.

blocks (47)

Note that this blocks can further be tweaked more but as the rule says ‘If its working , then no need to change’ :wink:

1 Like