The spook

unread,
May 13, 2015, 5:41:28 AM5/13/15
to mitappinv...@googlegroups.com

Hi,

For my science fair project I am creating an app that tells the students what is happening at school for that day. We have a 6 day cycle and every day has its own activity. I have a date picker and I want my program to store that date and somehow find it on a table/database. How will I go about doing this.

Thanks

SteveJG

unread,
May 13, 2015, 9:06:32 AM5/13/15
to mitappinv...@googlegroups.com
There are many ways of handling data of this type spook.  Something like this can be done using a Fusion Table using the Web or it can be done entirely on the phone using a TinyDB.   If the information is always the same for each of the six days, this app is relatively easy.   If the information changes, the app becomes complex.

Read about databases here   http://www.appinventor.org/bookChapters/chapter22.pdf   ... this discussion is incomplete but it does discuss the basic architecture that your project might need.

Where is the information about what is happening posted?    

 On a Web page?   Then use the WebViewer and go to the URL; possibly 'scrape' the required data from the Web page using the Web component and parsing the information.

On a Google Spread sheet that is shared?   AI2 can communicate with online Google docs.

Is the data coded into the app?   Perhaps six lists of data,  Mon, Tue, Wed, Thu, Fri, Sat  and one is called when the day is a specific day of the month.  There is a Clock component you can use to determine the day today for instance.  http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock

What have you tried?    Exactly what do you want to do?

Regards,
Steve

Abraham Getzler

unread,
May 13, 2015, 10:19:29 AM5/13/15
to mitappinv...@googlegroups.com
Google Calendar API in AI2 example by PhantomFoot ...

ABG

The spook

unread,
May 14, 2015, 4:19:05 AM5/14/15
to mitappinv...@googlegroups.com
Hi,


Sorry about the lack of information, I was in a bit of a rush. The information does change. Every day there is a new activity and every six days we start a new cycle. The thing is, sometimes because of other school wide events, the days are not always consecutive so it can't be repetition. Is there a way I can use fusion tables to input this data. Also, how do you store a date in a variable. 

Thanks,
Spook

Abraham Getzler

unread,
May 14, 2015, 2:01:51 PM5/14/15
to mitappinv...@googlegroups.com
http://appinventor.mit.edu/explore/ai2/tutorials.html

Work your way through the Pizza 
party tutorial.

ABG






SteveJG

unread,
May 14, 2015, 2:45:29 PM5/14/15
to mitappinv...@googlegroups.com
You can populate a Fusion Table with an Android device ; in my opinion, pure drugery and very slow.  A better way to populate a Fusion Table is to use a browser on your PC (sorry Mac in your case).https://support.google.com/fusiontables/answer/2571232 .    Use your Mac to create the updates to the school schedule, then use the Android to access the FT information possibly.

How do you store a date in a variable.   Hmm, depending on what you are doing with it   you can store the date as a string in a variable called Monday or Day1 or... ... May 30, 2015  could be entered as "5/30/2015"   or  "30/05/2015" for example.   If you need to manipulate the data, then you should use the Clock component and you might end up storing a data as the number of ms since 1970 -- strange but that is how it could be done.   If you use a fusion table, the Google documentation describes how you should use a date and the required format.

I would not use a Fusion Table if this information is for information only  the students to read.   Create a document using Google Drive and make the document URL sharable.  Your app would be as simple as using a WebViewer Url set to the address of the Google Document.  https://www.google.com/docs/about/  gets you started.

Monday  June 5 -Science Fair
            - Lunch with Teachers
Tuesday -June 6 -Free movie after school
Wed - June 7  Band practice is at 7 pm
                     Assembly at 2 pm

If this information is also posted on a school web page, you can use the Web component to 'scrape' the Web page for the specific activity information, depending on the format of the Web page.  Somewhere there is a post that talks about something like this a student did for a school in Europe..at the moment, I can not find the specific thread...sorry..it was sometime in early 2014.

Regards,
Steve 

The spook

unread,
May 15, 2015, 1:03:50 AM5/15/15
to mitappinv...@googlegroups.com
Hi,

Thanks for the help! I was just wondering, could I use a google doc even if I wanted to display only one day's events at a time???

SteveJG

unread,
May 15, 2015, 8:14:00 AM5/15/15
to mitappinv...@googlegroups.com
You could use a google doc to display one day at a time certainly.

Create  five or six google docs, one for each day.   Depending on the day of the week (the Clock component can determine if it is Monday, Tuesday etc), make the app point point to the appropriate Google Doc shared URL. In pseudo code ...  IF Now = Monday then Url #1 else if Now = Tuesday ... (using the various Clock format and conversion objects).

Announcing calendar events like this requires someone to update the Google Docs at least once every week or whenever a schedule change is required using your Mac and going to the Google Doc you would edit.

This is quite simple to try.    Create a dummy Google Doc, set it to allow Sharing, note the sharing url that will appear, use the sharing url in the WebViewer and view the page.

Does it work for you?

Regards,
Steve

The spook

unread,
May 18, 2015, 2:24:54 AM5/18/15
to mitappinv...@googlegroups.com
Hi,

That is a good idea, but it will not work as there are six days and on friday there are no activities. So say on Wednesday we have gym-Day 3, on Thursday we have singing-day 4 and on friday instead of a day five we don't have anything unless it is a schoolwide event. Also, the days don't always go in order. So Monday will never be a set activity. If you know a solution please post.

Thanks,
Dan 

The spook

unread,
May 18, 2015, 2:48:15 AM5/18/15
to mitappinv...@googlegroups.com
Hi,



Sorry, I forgot to say something on my last email. I want people to be able to look ahead and I don't want to update it every single week.

Thanks,
Dan

SteveJG

unread,
May 18, 2015, 11:12:09 AM5/18/15
to mitappinv...@googlegroups.com
You have several options:

*  Use a Fusion Table some how.

*  Use Google Docs

*  Use the Google Calendar API

*  Do some creative coding using the Clock component and possibly DatePicker etc.  The Clock is described here http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock , the datePicker is http://ai2.appinventor.mit.edu/reference/components/userinterface.html#DatePicker     and then you might have to use Lists and a TinyDB  in conjunction with one of the above.

Each of these 'soulutions' has its own issues.

You want a complicated schedule that you do not have to update weekly?     Show an example of a possible schedule .. your word description is not helpful.  ...and you want others to look ahead?  This is getting very complicated.  Perhaps you should look at the Inventor's Manual here  http://www.appinventor.org/book2     and do some tutorials first .


Here are a two forum discussions to view:


The discussions may give you additional ideas.


What have you tried Dan?    You are going to have to do your own coding and everything you desire might not be possible.


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