Hello Codi! - Explore MIT App Inventor PDF
Hello Codi! - Explore MIT App Inventor PDF
html
(http://www.weibo.com/mitappinventor) (http://mp.weixin.qq.com
/s?__biz=MzAxODE1NTc1MQ==&mid=201968203&idx=1&
sn=01f8946b01a98b63e97e201a812dc844#rd)
Hello Codi!
To build HelloCodi, you'll need an image file of Codi the bee. Download these files to your computer by clicking the following links. To download: after
clicking a link, right click on the image and select "Save As." Save the file onto your desktop or downloads folder, or anywhere that you can easily find
it later.
To use a component in your app, you need to click and drag it onto the viewer in the middle of the Designer. When you add a component to the
Viewer (#1 below), it will also appear in the components list on the right hand side of the Viewer.
Components (#2 below) have adjustable properties. These properties change the way the component appears or behaves within the app. To view and
change the Properties of a component (#3 below), you must first select the desired component in your list of components.
Step 1a. From the User Interface palette, drag and drop the Button
component to Screen1 (#1).
Step 1b.To give the button the image of the bee, in the Properties pane,
under Image, click on the text "None..." and click "Upload File..." (#2). A
window will pop up to let you choose the image file. Click "Browse" and
then navigate to the location of the codi.jpg file you downloaded earlier
(#3). Click the codi.jpg file, click "Open", and then click "OK".
1 di 4 12/01/2018 12:56
Hello Codi! | Explore MIT App Inventor http://appinventor.mit.edu/explore/ai2/hello-codi.html
Step 3. From the User Interface palette, drag and drop the Label component to the Viewer (#1), placing it below the picture of the bee. It will appear
under your list of components as Label1.
(2) Text property of Label1 to read "Touch the Bee". You'll see the text change in the Designer and on your device.
(3) FontSize to 30.
(4) BackgroundColor of Label1 by clicking on the box. You can change it to any color you like.
(5) TextColor to any color you like. (Note: if BackgroundColor and TextColor are the same, you will not be able to read your text!)
Here, the background color is set to aqua and the text color is set blue.
Step 4. Under Palette, click on the Media drawer and drag out a Sound component and place it in the Viewer (#1). Wherever you drop it, it will
appear in the area at the bottom of the Viewer marked Non-visible components. Under the Media pane, Click Upload File... (#2) Browse to the
location of the Bee-Sound.mp3 file that you downloaded earlier and upload it to this project (#3). Under the Properties pane, see that the Source
property currently says None.... Click the word None... to change the Sound1 component's Source to Bee-Sound.mp3 (#4).
Once you have the Blocks Editor in front of you, continue to the next step to start programming your app with blocks.
2 di 4 12/01/2018 12:56
Hello Codi! | Explore MIT App Inventor http://appinventor.mit.edu/explore/ai2/hello-codi.html
The purple
blocks are
called command blocks, which are placed in the body of event handlers.
When an event handler is executed, it runs the sequence of commands in
its body. A command is a block that specifies an action to be performed
(e.g., playing sound) when the event (e.g., pressing Button1) is triggered.
Now you can see that the command block is in the event handler. This
set of blocks means; "when Button1 is clicked, Sound1 will play." The
event handler is like a category of action (e.g., a button is being clicked),
and the command specifies the type of action and the details of the action
(e.g., playing a sound).
You can read more about the blocks and how they work here:
Understanding Blocks in App Inventor 2.
To "package" the app to your phone or to send to someone else, click the Build tab at the top of the screen. Under Build, here are two options
available for you to choose from:
Note: this barcode works only for your own device because it is associated
with your Google account. If you want to share your app with others via
barcode, you'll need to download the .apk file to your computer and use a third-party software to convert the file into a barcode. More information can
be found here.
2. App (save to my computer): You can download the app to your computer as an apk file, which you can distribute and share as you like by
manually installing it on other devices. (sometimes called "side loading" (http://www.techrepublic.com/blog/smartphones/how-to-side-load-
apps-on-your-android-device/3114) .
Review
Here are the key ideas covered so far:
You build apps by selecting components (ingredients) and then telling them what to do and when to do it.
3 di 4 12/01/2018 12:56
Hello Codi! | Explore MIT App Inventor http://appinventor.mit.edu/explore/ai2/hello-codi.html
You use the Designer to select components and set each component's properties. Some components are visible and some aren't.
You can add media (sounds and images) to apps by uploading them from your computer.
You use the Blocks Editor to assemble blocks that define the components' behavior
when ... do ... blocks define event handlers, that tell components what to do when something happens.
call ... blocks tell components to do things.
Scan the following barcode onto your phone to install and run the sample app.
If you'd like to work with this sample in App Inventor, download the source
code to your computer, then open App Inventor, click Projects, choose
Import project (.aia) from my computer..., and select the source code
you just downloaded.
Next steps
Now that you know the basics of how App Inventor works we recommend
you:
Tweet Salva
(http://creativecommons.org/licenses/by-sa/3.0/)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License (http://creativecommons.org
/licenses/by-sa/3.0/)
Contact Us
4 di 4 12/01/2018 12:56