creating an app that retrieves data from a tinydb

117 views
Skip to first unread message

graduation...@gmail.com

unread,
Aug 28, 2014, 10:04:07 AM8/28/14
to mitappinv...@googlegroups.com
Hello there
I would like to make an app that have some data stored in a tinydb 
it is like the Paris map tour but with a little twist

the app that I am trying to do is explained in the drawing below

how  or where can I Store the data for  the restaurants , hospitals,  pharmacies,

I have tried the tinydb but i have found that it stores only two items- a tag and one piece of data,   how can I get through that

 

please help

 


SteveJG

unread,
Aug 28, 2014, 10:12:50 AM8/28/14
to mitappinv...@googlegroups.com
Try Stephen's AI2 TinyDB tutorial ... https://sites.google.com/site/stevozip/home/AI2/tinydb  

It should help you code what is required.

If not, return and ask again.

Regards,
Steve

tros...@gmail.com

unread,
Sep 1, 2014, 12:24:58 PM9/1/14
to mitappinv...@googlegroups.com
My name is James. I too have a similar app that I am creating. The challenge that I am having the most difficulty with is that I want the information to allready be there for the user rather than have them enter the info. Basically when they enter their selection form the listpicker, it will display the address, phone number, and any detail that is pertinent to that location. I am not even sure if Tinydb is the correct option for this. I did like that link that was posted by SteveJG. It did answer some questions.

Enis

unread,
Sep 1, 2014, 12:35:07 PM9/1/14
to mitappinv...@googlegroups.com
Then you'll have to determine, through the TinyDB if this is a first run or not.  If it's the first time the app is being run, you'll have to populate the TinyDB before you go on.  The database for the TinyDB is on each users' device.  You cannot have a pre-filled database as part of your project.

SteveJG

unread,
Sep 1, 2014, 3:43:27 PM9/1/14
to
@James....   1) You can hard code the data, assigning specific data to each variable.  Then the data is there from the start.  Great if it never changes.
2) You can load the data into a List using a File control.   The File control would read a csv file you would use to populate the Lists and the TinyDB
3) Do as Enis recommends. Set one of the Tags in the TinyDB as a Boolean value to check whether this is first run of the app or not, if it is, initially populate the TinyDB with the hard coded data, if not, then do not.
4) Use the Web control to download the information from a Web page.
5) Don't use a TinyDB at all, keep all the information in a Fusion Table that your app will have to access on the Web.   Use the fusion table as your main database.
6) Populate the TinyDB from data stored on a fusion table at first run.   If the database is empty, let the fusion table fill it.
7) or you could.....

There are LOTS of ways to do this.    Have you read the free online book here:  http://www.appinventor.org/book2    or done the Pizza Party tutorial?   They may give you more ideas.

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages