Learning Target:
I can pair program to create an app.
I can close read (multiple times) a written tutorial to program an app.
I can use my resources (background knowledge, help menu, teacher resources, online resources and my co-worker) to troubleshoot and debug my app.
I can understand logic and syntax errors and debug an app by problem solving.
Concepts/ Vocab in this Lesson: syntax error, logic error, debugging
Task 1: Try Intermediate Apps
Now you are ready to take the next step!
You and your partner will choose an app from below (Magic 8 Ball, Snow Globe, Space Invaders, Where's My Car, Quiz Me and MiniGolf). You will then create the app using the written tutorial. Remember, this app will be more in depth and require closer reading. It may take both of you several times to understand the procedure. Do not give up! Remember how to debug- -run it, see what it does, then brainstorm solutions together to make the change. You will have several days to do this.
Choice Apps
Magic 8 Ball App (Beginner)
When it asks you to show a block with more than two inputs (anything with a mutator wheel on it), click on the wheel and add input (see .gif below). You must program all the way through the tutorial, including Part III (replacing the button with the accelerometer sensor) and Challenge 1 (make the 8 Ball speak) (hint: once you add the text to speech component, you will now have the 'call text to speech' block to use. Ask yourself, what 'message' do you want the computer to speak? (hint: the computer needs to read 'Label2.Text'). However, you will only be able to test this app by using the android devices. When turning in the screencast, be sure to show the blocks with what works on the app.
Snow Globe App (Beginner)
You may find the image in the AI2 Images & Sounds folder in your Google Stream. Please be sure to close read the tutorial as the images show concepts different than how you are supposed to program it. When it tells you to define a procedure, be sure to create one before you try to use it (see purple .gif below). Also, when it asks you to show a block with more than two inputs (anything with a mutator wheel on it), click on the wheel and add input (see .gif below) retype it as 'ball'. Try using your background knowledge from the cat app and use the LMC Copyright Free Resources to add sound when the accelerometersensor.shaking do block.
Space Invaders App (Intermediate)
The image sprites are in the directions. Adjust the Canvas to a height of 'Fill Parent' so that it takes up more of the screen. The Clock component is now in the Sensors palette and not the User Interface. Please note that the directions are not very clear when told to ADD to blocks. Make sure you are ADDING to the existing event handlers and not creating duplicates. If you are getting red x's, you don't have it correct . If the bullet is moving too slow for your skill, you may adjust the speed. Make sure it is not so fast that I cannot see it. If you are struggling with the app not working (hint: likely because you have red x's on several of the event handlers), watch this troubleshooting video to help you out. You may fast forward to the part about your app. Lastly, if you receive a Runtime Error when the ball sprite hits the saucer sprite, double check that you are trying to + 1 to the actual score (0) and not the label score ("Score").
Where's My Car? (Intermediate)
Do not download the source code. I would also encourage you to be sure you are using the instructions that include Chapter 7 in the url. Otherwise, you don't have step by step instructions. Don't forget to add non-visible components so you have the code blocks when it is time to code.
Quiz Me App (Intermediate)
When you add the image, I would suggest making it height: 300 pixels and a width of fill parent. Also, the images provided in the tutorial do not work. You may find your own images and create your own questions. When you download your images, be sure to rename to a name that is easy to remember:) You do not need to do the quiz on baseball. Once you download the images you want to choose (be sure they are .jpg, .jpeg, .png), right click them in FILES and rename them to something simple (be sure to keep the file extension); for instance cat.jpg Then you may upload them to use in your app. When you try to add more than two blocks, you will need to click on the mutator wheel and drag in another input (see .gif below). INITIALIZE THE CURRENTQUESTION INDEX to 1 (the tutorial says 0.) If you are struggling with the app having errors, watch this troubleshooting video to help you out. You may fast forward to the part about your app.
Mini Golf App (Challenging)
Do not download the source. The Random Integer block shown in the tutorial is the same as the one in the math drawer and works the same reading left to right as it does top to bottom. If you want it to look like it does in the tutorial, right click on the block and choose External Inputs. The 'arg socket' is the blue wheel (mutator), which allows certain blocks to expand, shrink or even change their functionality. (See gif below.) Hint: When you add code to the Clock Timer event handler, make sure you are not creating two. Just add the second if-then-else below the other. If the Tee is not sitting at the bottom (because you have a canvas with a height of 300 pixels, set the 'Prepare Screen' Tee block to read Tee Y = canvas height - tee height / (DIVIDED BY) 20.) While screencasting, be sure to show the arrows moving the ball while on the tee and the fling working to bounce the ball off of the obstacle and into the hole. If you are having trouble with your app, please try watching this troubleshooting video for common mistakes.
Task 2: Understanding Errors
A bug is an error which stops your code from working as expected. There are two main types of bug which can occur in a program:
Syntax Error: This happens when the rules of the language have been broken, e.g. by misspelling a command. Syntax errors usually stop the code from running. Languages like App Inventor provide code in ready-written blocks, so you won't make many syntax errors.
Logic Error: This means your code runs, but doesn't do what you expect. Unfortunately, it's still possible to make logic errors in App Inventor.
Finding and fixing these errors in a program in known as debugging.
Task 3: Debug your App/Test and Turn in
This part often takes longer to solve a small problem than creating and programming the entire app. Spelling matters! Capitalization and spacing matters! Get your app up and running on the android and see how it behaves. Ask yourself, where is it going wrong? What does the error say? In what piece of code is it malfunctioning? Work through your frustration... in the end you will be glad you did!
Make sure you test your app and ensure it is working correctly and then screencast and turn in.
Task 4: Adding to Your Reflection Blog
Go to your Reflection Blog to the entry titled "Debugging." Explain an error you encountered while programming and describe how you fixed it. If you didn't have an error, explain where you could have had a logic error and a syntax error to help you further understand.
Extension Activities
If you have completed your app, defined the vocab and finished your reflection entry for this lesson, you may attempt some extension activities or a new app altogether. Extension activities would include adding a Game Over screen, adding obstacles to your game, adding a second level to your game, etc. In order to do this, use your resources, browse App Inventor or just Google it! You may also try doing one of the other choice apps or try a completely new app found at App Inventor.