Hello Geetha
Much depends on what your app does. TinyDB cannot be "closed" so that's interesting :)
So, your User is in the App, things have been done (like filling in a form or playing a game) and information has been stored in TinyDB?
Do you want to be able to hand the device to another person for them to use the App?
If my guesses are right, then you probably have a button to confirm form entry or save a game score. That button, having stored the data, can then run a little procedure to set things the way they were originally in the App.
If you are storing information for more than one User, then you will need a way to give them a unique identification.
So, can you tell us what your app does, so we can give more specific help?