Skip to first unread message
Assigned to scottfr...@gmail.com by me

terylb...@gmail.com

unread,
Apr 28, 2014, 10:03:49 PM4/28/14
to mitappinv...@googlegroups.com
I loaded an aia of a project that I was having trouble with editing and loading to phone with wifi. In the block editor the response times are now normal. Previously I had a few projects that I gave up on because of the delays. On the project I tested, making any changes within the block editor previously took up to 20 seconds to execute. Also, loading to my phone took about 20 minutes for the program to start running. I have a gadget on my screen that shows the % of the microprocessor being used and AI2 was maxing out above the red area at about 70%.

With the test version editing is now normal and downloading only took a couple minutes for the the program to start. When I retried the same project with the old AI2 it was still running extremely slowly. I gave up on trying to load to the phone after about 5 minutes.

I didn't check for other functionalities such as the drop down changers that I saw others say worked differently in the test version. The wavy edge on the right side of blocks threw me off a little...I assume it's by design. I don't know if there were some "sacrifices" made to allow the fix, but I certainly liked the improvement from AI to AI2 re how the blocks were redesigned and manipulated. I have a couple of projects that are in the unwieldy stage that I am postponing working on due to the slow down.

I do have a few questions regarding AI in general. Will it ever allow running Android in a window? Is the Android system what limits the canvas size to 1000x1000? It would be nice to be able to create files that can be printed without jaggies...even if the canvas being saved is hidden or expanded beyond the phone's screen. I have a used tablet that I haven't gotten around to loading the AI Companion on yet...but it would be nice to "paint" rich pictures via Chromecast on a tv...or at least to the resolution of a good tablet.

BTW App Inventor has been a Godsend to me. I have a lot of ideas I developed in Amiga Basic before '95. When I switched to a PC I lost access to programming which was frustrating given the jumps in chip speed that could have been available. A friend who teaches at Hofstra told me about App Inventor which he uses in his classes. I really have avoided scripted languages and compilers. I'm graphics oriented. Every text I looked at regarding C or even Java seemed to have an arcane feel to the syntax with a very minimal emphasis on graphics. I suppose eventually I'll have to switch to a Java SDK but I REALLY like the snap together system. That changes can be made WHILE a program is running is great. Also, AI has given me a good feel for the capabilities of Object Oriented Programming. AI has been empowering for me!

Scott Ferguson

unread,
Apr 29, 2014, 5:44:28 AM4/29/14
to mitappinv...@googlegroups.com, terylb...@gmail.com
Thanks for the positive feedback Terrylb!
I am not sure what you mean here:
only took a couple minutes for the the program to start.
Are you downloading some files from the Internet or is your app doing some loop processing?
Keep in mind that App Inventor will wait for a foreach or while loop to complete before continuing processing.
This means if your loop is plotting something on the Canvas then the plot will not appear until the loop exits.
In order to display items on a Canvas I generally use a Clock Timer event block to contain the blocks that will change the Canvas and set it's Interval to 0 for maximum processing speed.

I first enable the timer by setting it's Enabled property to true.
If you need to increment a counter index value you can do that inside the Timer block.
You can have an if block inside also to determine when to stop the Timer by setting Enabled to false

This touches on the idea that App Inventor really shines with it's many event-driven blocks.
The user does something then the app responds in some way with an event handler block (Canvas Touched, Button Click, etc.)

If you do use while or foreach limit their processing to a short amount of time -- I would say no more than 1 second.
If longer than that, you should use a Clock Timer.
---
hAPPy INVENTORing!
Scott

Scott Ferguson

unread,
Apr 30, 2014, 6:18:05 AM4/30/14
to mitappinv...@googlegroups.com, terylb...@gmail.com
(this was forwarded from Scott's email)
Scott, I can't figure out how Forums work(I couldn't find my posting the next day), so I'm just going to treat this like email and reply.

I was talking about the delay from when I send a project to my phone with wifi and QR Scanner and when it actually starts running. Just like the AI2 block editor slows down when a program grows, the time it takes to set it up with the AI Companion on the phone also takes longer as the project grows in size. (This is especially frustrating when I make a change on the Designer page and AI2 starts the program over from scratch. For example simply changing the text on a button.) 

As I said, I loaded an aia of an old AI2 project that was unwieldy in the Block Editor because of its size that also took over 20 minutes for the AI Companion to get it set up on the phone. Even then, once it loads in it works fine. In the past when I loaded the same project as an .apk onto the phone it works immediately when I click its icon. I was trying to tell you that the Test Version of AI2 fixes that long delay just like it fixes the sluggish Block Editor.

I already figured how to work around completing a loop with a Clock to make things appear one at a time. That said, it can actually be an advantage to have, for example, 36 variously drawn rectangles in a loop pop onto the screen at once. I DO use a clock if I want them to appear continuously and 1 at a time.

Thanks for responding. I hope I can figure out how to keep a thread going on a Forum which I've never done before. ---Terry

Scott Ferguson

unread,
Apr 30, 2014, 6:19:59 AM4/30/14
to mitappinv...@googlegroups.com, terylb...@gmail.com
This is how I replied to Teryl -
Teryl-
To find your posts with a PC/Mac and web browser-
Click the triangle in the search box at the top of the forum:


In the dropdown enter your email address in the textbox to the right of the 'Posted by' button.
Click the blue magnifying glass to find all of your posts (there should be two of them)
Now, please post your replies there instead of emailing me directly in the future as we want others to benefit from the discussion as well.
I am going to post your reply to me there now.
Thanks.
---
Scott

Reply all
Reply to author
Forward
0 new messages