You are on page 1of 10

Week 8 Lessons

MIT APP INVENTOR


COUGER CAFÉ APP
Agenda
• Date / Time
• System
• Timepicker
• Saving and Retriving Data to Files
• Cougar Café
• Incorporate Datetime
• UI Cleanup
• Logic for delivery, pickup now and pick up time
Datetime
• You can get system and current time by placing the clock object from
the sensors palette
• Clock has several procedures that you can call to get or set time
• Time picker works in a similar fashion as the clock does. With time
picker you can pick and set the time, however you need to create the
format.
Datetime
Timepicker
Saving text File to the Phone
• You can save a text file to the phone with various data that you
capture on the screen.
• This can act as your datasource
• You can also use a csv file in a similar fashion.
• In order to use the database (Tiny DB) you should have a
understanding of how databases work
• Cougar Café can use either a csv or flat file to save and retrieve data
Save and Retrieve Data
Save and Retrieve Data

• You can either use append or savefile. If you use append


you can continue appending to the file.
• \ saves the file to the SD card of the phone
• You need to put the file extension on the file. If you do not
it will treat it as a text file.
• Retriving the file is 2 fold
• The click event to get the data
• The GotText event to attach it to the multiline text
box. The “text” is a variable of the data itself.
• You will need to format this data on save, to retirive it
the way you want it.
Cougar Cafe
• Implement a datatime timestamp for the user
• This should be captured along with the user info and saved to the file
• Use the time picker to capture the pickup time
• Logic - Give the user an option (checkbox, drop down list, radio buttons::
radio would probably be most appropriate) of delivery, pick up now, pick
up later. If picking up later then use the time picker
• Save all user data, along with timestamp, etc to the flat file. Data can be
used for shopping cart as well as any other screen.
• User should go to either a lunch or breakfast menu once all the info is
captured and saved.
UI Cleanup
• Ensure that you are closing the keyboard when not in use or after entry of
something,
• Use inputs rather than creating your own inputs (looks similar to the
timepicker), the look is cleaner.
• Start error checking and trapping
• Ensure that your objects are properly listed. Ie. Numeric, multiline, visible.
• Use label and or textbox visibility and set to true to make them visible when
needed.
• Test and troubleshoot each time you add a new element.
• Start versioning

You might also like