How do I save global variable to tinydb?

Hello all,
I was making a app where I have used 2 vertical arrangement to work as 2 screen. One will be invisible and then other will be visible. So when the user opens the app for 1st time, it will ask for camera permission. From the next time it will open from the scanning screen. I used global variable for this reason but it is getting reinitialised very time the app is opened. I want to save the global variable to the tiny db for this reason so that it persists on the phone even the app is restarted.
Thank you in advance.
Plz bare with me as i am new to this platform.

try something like this

add the camera permission and the screen name

You could try something like this, modify code according to your needs


thank you brother

it is working fine! thank you very much

1 Like