Skip to first unread message

Matthew Fundak

unread,
May 8, 2019, 11:30:51 AM5/8/19
to MIT App Inventor Forum
I have a student creating a project that is based around being active. I had her do a print screen and send me the code in a word document. I have in turn attached said document to this post. I do not see why it doesn't work. she does not get any errors, but nothing shows on the listview when the button is selected that is supposed to show the choices. The listview visible is checked on the interface.
code.docx

TimAI2

unread,
May 8, 2019, 11:41:26 AM5/8/19
to MIT App Inventor Forum
Not enough information with just those blocks....

Ask your student to:

Save a backup - project aia to PC

then

Expand any collapsed blocks

Right click in the Blocks editor and select Clean up Blocks

Right Click in Blocks Editor and select "Download Blocks as Image"
(use image editor to crop etc. if required)

In the forum, click on the image button to upload your blocks image

or better still post a copy of the aia




Matthew Fundak

unread,
May 9, 2019, 9:27:58 AM5/9/19
to MIT App Inventor Forum
Hopefully this uploaded correctly. Thanks for the help
FitnessApp25.aia

TimAI2

unread,
May 9, 2019, 10:13:34 AM5/9/19
to MIT App Inventor Forum
I'll take a look....

ABG

unread,
May 9, 2019, 10:27:12 AM5/9/19
to MIT App Inventor Forum
Judging from the screen shot, you are adding new data in the wrong place.

Where are the 3 ADD ITEM TO LIST statements
for your 3 new data values, going into the 3 global lists?

ABG

addDataButton.png

TimAI2

unread,
May 9, 2019, 11:30:53 AM5/9/19
to mitappinv...@googlegroups.com
OK, quite a few things going on here that need addressing....

  1. Not switching screens correctly. This will eventually cause a memory crash of the app. See below for solutions to this, also the tabbed screens demo, for using just one screen
  2. Images could do with size reduction - actual and dimensions - design for the device the app will be used on.
  3. DRY programming (Don't Repeat Yourself). Create the activity lists once in blocks and save them to the tinydb, then call them from there when needed
  4. The Activity Log was not actually saving anything to the tinydb at all! I believe you want to save the "day/activity/number of times" as one item for the listview
  5. I have produced some blocks that do this as an example, there are many different ways to achieve the same thing - the listview is refreshed on every save. These are the only blocks needed on that screen...
  6. [edit] it would also be good to sort the list before saving to the tinydb / or displaying - this is not trivial if you want it in day order, see the links below
  7. There is only one list - this can be manipulated to extract individual datas if needed
  8. The key is to get the data structured correctly, save to the tinydb and/or a list if you are going to manipulate it, and then call back the data as required
  9. However a good effort :)

blocksFitness25.png


Use different screens wisely

If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...      
The recommended method of switching screens in App Inventor
(Thanks Taifun)

Also see demo: multiscreen.aia

If you haven't done it already....


Reply all
Reply to author
Forward
0 new messages