Download Blocks as Image produces no response

70 views
Skip to first unread message

johnoflet

unread,
Jun 11, 2019, 2:20:32 PM6/11/19
to MIT App Inventor Forum
Right-clicking the big Screen of my App in App Inventor produces no response - the selection box simply goes away.
Doing the same with two other smaller screens does work - it produces a 'Save or Open' dialogue box.
So, I wonder, is there a size limit to the png image produced by this function?
Is there a way to copy an image of the code blocks.
I want to be able to explore my code blocks to remind myself how the darn thing is supposed to work!
I am aware this question has been asked but there has not been an answer I could find.

TimAI2

unread,
Jun 11, 2019, 2:22:16 PM6/11/19
to MIT App Inventor Forum
How many blocks on that screen ?

ABG

unread,
Jun 11, 2019, 2:33:37 PM6/11/19
to MIT App Inventor Forum
This is how you track them for reading ...

Use the right click Download as PNG option on each procedure or event,
name the files appropriately, and save them in a github project.

ABG

johnoflet

unread,
Jun 11, 2019, 2:37:39 PM6/11/19
to mitappinv...@googlegroups.com
Right-clicking gives the option to 'Delete 3531 Blocks' so I guess that is the number of Blocks.

johnoflet

unread,
Jun 11, 2019, 2:40:13 PM6/11/19
to mitappinv...@googlegroups.com
Thank you so much - right-clicking on each Procedure and saving with the Procedure name will do nicely!

Chris Ward

unread,
Jun 11, 2019, 3:31:42 PM6/11/19
to MIT App Inventor Forum
Hi

Actually, I had the same problem - turned out that the Save Dialog was under the FireFox Window! So you should find that to be the same in your case. I don't know if there is a finite limit to the PNG size but of course a large amount of Blocks will take longer. Try using 'Clean Up Blocks' first, this arranges them in one column.

johnoflet

unread,
Jun 12, 2019, 3:24:38 PM6/12/19
to MIT App Inventor Forum
Thanks Chris. I tried the Cleanup and searched for a hidden Save Dialog but none was there. Thanks anyway; it might help others.
I am happy with downloading each Procedure separately as a work-around.
I tried to close the topic but probably messed up!

Evan Patton

unread,
Jun 13, 2019, 1:49:54 AM6/13/19
to MIT App Inventor Forum
I know that there is an issue with older versions of Safari where the blob URLs are limited to a certain size, so large projects will fail to download if the encoded PNG file is too large. However, I've never seen an issue with Chrome or Firefox. If you'd like to send me your project (or give me permission to access your account), I can run some tests and see if there's something in particular that is preventing you from downloading the whole image.

Regards,
Evan

johnoflet

unread,
Jun 13, 2019, 4:59:22 AM6/13/19
to MIT App Inventor Forum
Evan, I've tried Chrome as well as Firefox and both simply do nothing for my big Screen (Screen1).
The other two small screens download easily.
I've attached the .iai file which is what you need to take a look I guess.
I'm trying to simplify and speed up the code so it's a mess but this is the Project which refuses to download the Blocks as a png.

Thanks for taking a look, if you get time.
Regards, John
CashTillByCategory_V35.aia

TimAI2

unread,
Jun 13, 2019, 7:23:06 AM6/13/19
to MIT App Inventor Forum
Won't Download blocks as image for me either on Chromium Linux

ABG

unread,
Jun 13, 2019, 9:53:00 AM6/13/19
to MIT App Inventor Forum
It does not look like you are doing enough to void repetition in your blocks.

Where are your procedure parameters, that let you reuse the same procedure for different data?

Why do you have global variables cust0-cust7 ?
Will you only have 8 customers?

Why so many buttons, when you can use List Pickers easily?

See these samples for how to code with fewer blocks ...

ABG
AddNewItemCust1.png
AddNewItemCust7.png

Chris Ward

unread,
Jun 13, 2019, 9:55:36 AM6/13/19
to mitappinv...@googlegroups.com
Hi again

There are a few things you can do to make your App run more efficiently and be a little bit smaller in size.

For example:
  • You do not need a Notifier Block for each different notification, you can simply call one when and wherever required.
  • It's not necessary to delete list items to clear a List - simply reset the List with a 'create empty list block'.
  • The 'GoToPage' Procedures are practically identical - Define just one with arguments (variables) 
 
Edit:
  • To switch Virtual Screens, have each arranged on it's own Vertical Scroll Arrangement (screen height-width 100%) - then to switch screens, you do not have to change the visibility of every component, just the Vertical Scroll Arrangements :) That will make a difference to the User experience in terms of speed of display and your Code will be much simpler.
  • Make a dedicated folder in SD for your App - DCIM is for storing Digital Camera Images :)
  • The customer numbers could be a List instead of a bunch of global variables.
  • Re ABG's suggestion about replacing button sets with a ListView or ListPicker - this would make your GUI much more User friendly and reduce your code blocks considerably, so I think that's a 'no brainer' improvement.

Chris Ward

unread,
Jun 13, 2019, 9:56:57 AM6/13/19
to MIT App Inventor Forum
@ ABG - snap! :)

Chris Ward

unread,
Jun 13, 2019, 10:37:37 AM6/13/19
to MIT App Inventor Forum
Hi Evan

First off - hope you are safe and well in HK.

It is odd that the png is not created, we see a lot of Projects this size and have not hit this issue before? The Blocks work with the Backpack (Copy All, Paste All), though I just noticed that the Backpack blocks count works differently to the Viewer blocks count, which I think could make people nervous about whether or not the BP contains all the Blocks of interest. In this case, the count is 3491 v 138, so some might think that 'copy all blocks to BP' has failed.

johnoflet

unread,
Jun 13, 2019, 2:41:26 PM6/13/19
to MIT App Inventor Forum
First, some more information.
I progressively deleted Procedure Blocks, used Cleanup Blocks then Download Blocks: Starting with the failure to download at the full set of 3491 Blocks I had to delete until I had only 1507 Blocks (this is not the accurate level just an indication) remaining and then the normal Save Dialog appeared and worked fine.


ABG:

<It does not look like you are doing enough to void repetition in your blocks.
Where are your procedure parameters, that let you reuse the same procedure for different data?>
So sorry, ABG, but your comment  means nothing to me at present but I'll go hunting; thanks for the clue. Ah, I see it's avoid, and after seeing other comments I can get the gist now and will indeed use parameters as I improve the code, thanks.


<Why do you have global variables cust0-cust7 ?
Will you only have 8 customers?>
I Only have a max of six 'Customers' (Cust0 is 'Refunds' and Cust7 is EndOfDay Adjustments). It's a crude Point Of Sale App which is designed to cater for up to six piles of goods temporarily placed while Customers browse for more goods until they are ready to pay. The App simply collects Sales tagged by Category informs a Customer what they owe and writes to text file once a Customer has paid. It has to cater for changes in the piles of goods and for a Customer who decides against paying, as well as demands for Refunds!


<Why so many buttons, when you can use List Pickers easily?>
As a POS screen it seemed easier on the operator to press a button (for Category - last button counts, and for Price - button values add up) rather than mess with list pickers, but thanks for the heads up. Something to consider.


<See these samples for how to code with fewer blocks ...>
Thanks, I have got them to read and learn from and I shall find them instructive, but other tasks are pressing, such as our annual concert tomorrow.

Chris:
Thanks for the tips re calling just one Notifier Block, and create-an-empty-list to delete the contents.


<The 'GoToPage' Procedures are practically identical - Define just one with arguments>
Yes, I will use arguments now I am aware of them :-)

<To switch Virtual Screens, have each arranged on it's own Vertical Scroll Arrangement (screen height-width 100%) - then to switch screens, you do not have to change the visibility of every component, just the Vertical Scroll Arrangements :) That will make a difference to the User experience in terms of speed of display and your Code will be much simpler.>
Yes, I am using the switching idea partially but should go the extra mile  to put sections into Vertical Scroll Arrangements; it will be easier to just switch chunks on and off I agree.


<Make a dedicated folder in SD for your App - DCIM is for storing Digital Camera Images :)>
Yes, I do know that but I wanted to it working and it just plonked its files in there. Ok, I'll tidy up :-)


<The customer numbers could be a List instead of a bunch of global variables>
I'll take a look but I'm feeling overwhelmed and I find Lists most intimidating...

<Re ABG's suggestion about replacing button sets with a ListView or ListPicker - this would make your GUI much more User friendly and reduce your code blocks considerably, so I think that's a 'no brainer' improvement.> Well, I felt pressing buttons in a Sales environment would be quicker and less prone to error than pressing on a list picker and then selecting an item from the list. I will keep in mind for future experimentation.

This was meant to be a quick painless creation of an App but it's grown and not in an elegant way I fear. It is working live in a Sales environment (family business; this is NOT an Accounting App!) but I want to improve speed and remove some Reports code as I now feel our needed Reports are best done with a Spreadsheet Pivot Table.

People, many thanks for your kindness and indeed sheer speed in replying; you have solved my short term problem (obtaining pictures of the Blocks so I can see the whole thing conveniently, even though I can't get a picture of the whole thing at once) and you have given me really useful pointers to make significant improvements which I shall be following up.

I'm feeling slightly overwhelmed and need to lie down in a darkened room for a while :-)
Keep up the excellent helpful work.
Regards, John

ABG

unread,
Jun 13, 2019, 5:46:51 PM6/13/19
to MIT App Inventor Forum

ABG

unread,
Jun 14, 2019, 10:11:40 AM6/14/19
to MIT App Inventor Forum
I forgot to include this small POS sample showing off TinyDB NameSpaces ...

ABG
Reply all
Reply to author
Forward
0 new messages