Help with tiny db

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

I found the main problem… hahaha…
The problem is caused by check mark “checked” in the “Designer” for all the “switches”. Somehow, after the screen initializes, even though it reads the TinyDb and sets up the switches accordingly, the default “switch setting” of “checked” still resets it.

After I ''uncheck" all the “checked” for all the switches, now it worked nicely. Is this the way it was designed to act? Curious.

Thank you all for your support and effort.
Donald

@Vaibhav You only need this one
bild

@Donald_Hwong

Yes, if in designer is false then in your initialize should also be false

bild

1 Like

Yes I tried that previously but don’t know why it was not working.

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