2016년 12월 8일 목요일

Looking to understand how info is gathered


I am having some issues with certain parts of my app not working.  I have a few calls to the web and  I think its because information is not yet available, when the next procedure is asking for it.  So if someone could explain how info is gathered and if there is a way to manage it in an order before the next step occurs.  Example I have the following, I placed the procedures in the block as I would like them to occur. 

 screen.png
-- 
It's hard to comment on your long list of procedure calls in Screen1.Initialize 
without seeing what's in those procedures.

So I'll address mistaken mindsets you have to unlearn, learned from
other environment.

Arduino and BASIC programmers often come to AI2 with the idea that
they are in total control, and everything they ask for will come back done
immediately and without fail.

AI2 programmers must think more like kids setting up games of MouseTrap
or setting up long chains of dominoes on a gym floor,
or like industrialists setting up factory floors who lay plans for how
work will flow from work station to work station.

Almost every thing takes time, and has an event block to catch the 
resulting post-completion flow.

This means that there's a limit to what you can cram into a procedure.
There's no way a procedure can handle both the start and end of a long running process.
(Long running = longer than the time to snap your fingers.)

Any kind of Web or online database access or GUI interaction takes time,
so it's broken into parts aught in event blocks.

-- 
the web component works asynchronously
this is one of the most important concepts you have to understand while using App Inventor

for example in a button.click event:
call Web.1.Get

and in the Web1.GotText event a little bit later you get the result back

see also the filebyfile example https://puravidaapps.com/filebyfile.php how to download a file, wait until it has been downloaded, then download the next file, wait until it has been downloaded etc.
A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

-- 
I will look at your filebyfile.  I am assuming I should be able to incorporate its ideas to download info from the procedures in the same way.

-- 


댓글 없음:

댓글 쓰기