2014년 12월 10일 수요일

TinyDB not saving when distributed

I have no problems saving the file while testing, but when I install it on my phone, it doesn't and not sure why. I have installed the TinyDB example on my phone and that works just fine. Is there something I need to check on?




how do you read the data from TinyDB again?



As Taifun said... you've shown how you save the data.  Where are you READING the data back??? Show a screenshot.



Here is my save routine.

I want to be able to do: 

1. Add New
2. Update
3. Delete current record
4. DELETE ALL records

What this is a training app for new police recruits. We log the progress every day of training. I email the results back to office for more processing. At the end of the training, I want to clear out the database and start fresh for the new one.




I found my problem for loading the data but now I need to figure out how to UPDATE the record without adding a new one. Is there an example on how to do this?

I will post my final example for all to view when it is working. 



Jim... Just write the info to the TinyDB using the same tag... it'll overwrite the existing information for that tag.



So, I'll check to see if the record exist and if it does, report the ELSE routine, correct?

I'll give that a try.



That's correct.  If it exists, it'll overwrite it.  If it doesn't exist, it'll add it.



Excellent! It's working like a charm.

The last thing I need to do is the delete the entire DB once the training has been completed. 



The only way to do that Jim, is to use the Clear Tags block... But be CAREFUL because it will, as it says, clear all tags and if done when any of your training is active, you'll lose everything.  I'd password protect access to that...



Thank you Enis. Is there an example on to use the Clear Tag All?



Doesn't need much of an example Jim:




Your correct! I got it working and yes I will password this function. 



Glad to help Jim...


댓글 없음:

댓글 쓰기