2014년 12월 4일 목요일

Viewing TinyDB during testing

I have read the post concerning viewing a TinyBD and that it needs the phone to be rooted, but isn't there a way to view or build a list of the data on a new screen while developing it?

Also, is there a way to completely delete the records in the file?



call TinyDB1.ClearAll  completely deletes the records.

 "viewing a TinyBD and that it needs the phone to be rooted" ...you did not provide a link but that is certainly not a requirement for viewing the contents of a TinyDB.     Load the TinyDB to a List or List of Lists and you can view the information in an HTML table or display.  Simple? No.   You need to coding a routine to show the elements that are in the TinyDB, put them in a list and display them in a label, html table (see below) or in a series of labels; in fact you can make a pseudo spreadsheet by using a Table component and labels though that would be awkward.

See Taifun's Dynamic Table Layout ...   http://puravidaapps.com/table.php        His example uses csv files, but the input could be from a list.

Another way would be to send the contents of the TinyDB to create a csv file...again, you will need some creative coding.  You will be able to view the contents of the TinyDB as a csv file.   How do you do that?   Lots of ways, be creative.



Did this help?




correct, to be able to view TinyDB, which is actually an XML file, you need root access, but to view the data, first get the tags and then loop through the tags to get their values, see also the documentation http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB

any GetTags()
Return a list of all the tags in the data store
any GetValue(text tag, any valueIfTagNotThere)
Retrieve the value stored under the given tag. If there's no such tag, then return valueIfTagNotThere.



Once again you guys rock!

This is a big project and AI2 has been able to handle it just fine. I am sure I could do things better but for now it's working.

댓글 없음:

댓글 쓰기