1. App Inventor has two main windows. What are they and what do they do?
The App Inventor programming environment has two windows: the component designer and the blocks editor.
You use the component designer to define the user interface of the app as well as any non-visual components you need. User interface components include buttons, labels, image objects, and textboxes. Non-visual components include the Texting component, the Sound component, and the Text-To-Speech component.
You use the blocks editor to define the behavior of the app. An app's behavior is specified in terms of event-response handlers-- when an event occurs, what functions does the app perform in response.
2. a. How do you test an app while you're developing it?
You can plug a phone in to the computer during development and the app will appear on it. As you make changes in the component designer, the changes will occur on the phone. As you define behaviors in the blocks editor, you can immediately test them on the phone. This is called "live testing".
If you get an app working with live testing, then unplug the phone, the app is not yet really deployed and you won't be able to use it. To deploy an app so that you can use it unplugged from the computer, you use the Package for Phone menu in the component designer. You can either have App Inventor display a barcode or generate a .apk file for the app. You can scan the barcode with a barcode scanner on your phone, and it will install. You can also copy the .apk file for use on the phone or the emulator.
You can develop apps and test them using the Android emulator. The emulator behaves like an Android device but runs on your computer.
3. The tutorials ask you to rename components in the Component Designer, different from their default names. Why is this important?
After you create the components for your app, you'll program their behavior in the blocks editor. When you open the blocks editor, there will be a palette drawer for each component containing event-handlers, functions, and properties for that component. It is important that you provide descriptive names in the component designer so you can easily identify the component, by name, in the blocks editor.
One important style guideline is to have the component type as a suffix on each component name. So if you have a button in your app for making the kitty purr, you'll call it PurrButton.
4. In an app Inventor app:
A component is either a user interface object, e.g., button or textbox, or a non-visual component. Think of non-visual components as entities in the app that provide some functionality but aren't seen. The Texting and Sound components are prime examples.
b. What is a property?
A property is data associated with a component. Most visual components have properties like width, height, and background image which define how they look. You can conceptualize a property as a named memory cell holding a number or some text, something like you'd see in a spreadsheet.
An event is something that occurs while the app is running. Probably the most common event is the user clicking a button. Other events include a text being received by the phone, and the user dragging their finger across the screen.
App events can be categorized in the following manner:
d. What is an event-handler?
The app's behavior consists of a set of event-handlers. An event-handler is an event together with the function calls an app will perform in response:
event -----> function call 1
function call 2
function call n
e. What is a "call"?
To call a function means to invoke it. The phone has a function Sound.Play. When you click the button in HelloPurr, you call the function Sound.Play-- you tell Android to do it.
5. For the HelloPurr app, name the:
for part I:
components: There is a label displaying "Pet the Kitty" and a button you click to make it happen. The enclosing screen is also considered a component, and there is a non-visual Soundcomponent.
calls to functions: Sound1.Play
6. Some calls to functions require arguments (also known as parameters). Which calls in HelloPurr require arguments?
Part II of Hello Purr has a function with a parameter. In that second part, you add a Sound1.Vibrate function call so the phone will vibrate when you "pet" the kitty:
A parameter is data the function needs to do its job. The Vibrate function needs to know how long to vibrate. Later we'll work with a MoveTo function that moves an image sprite. It will have two parameters, one for how much to move horizontally in the x-direction, and one for how much to move vertically in the y-direction.