SlideShare a Scribd company logo
1 of 54
App Inventor Beginner Tutorials
Than Sare
1 Four Simple Tutorials for Getting Started with App Inventor
1. TalkToMe: Your first App Inventor app
2. TalkToMe Part 2: Shaking and User Input
3. BallBounce: A simple game app
4. DigitalDoodle: Drawing App
4
23
33
47
Than Sare
Four Simple Tutorials for
Getting Started with App
Inventor
Than Sare
TalkToMe: Your first App Inventor app
This step-by-step picture tutorial will guide you through making a talking
app.
To get started, go to App Inventor on the web.
Go directly to ai2.appinventor.mit.edu, or click the orange "Create" button from the App Inventor
website.
Than Sare
Log in to App Inventor with a gmail (or google) user name and password.
Use an existing gmail account or school-based google account to log in to ai2.appinventor.mit.edu
To set up a brand new gmail account, go to accounts.google.com/SignUp
Than Sare
Click "Continue" to dismiss the splash screen.
Than Sare
Start a new project.
Name the project "TalkToMe" (no spaces!)
Type in the project name (underscores are allowed, spaces are not) and click OK.
Than Sare
You are now in the Designer, where you lay out the "user interface" of your app.
The Design Window, or simply "Designer" is where you lay out the look and feel of your app, and
specify what functionalities it should have. You choose things for the user interface things like Buttons,
Images, and Text boxes, and functionalities like Text-to-Speech, Sensors, and GPS.
Add a Button
Our project needs a button. Click and hold on the word "Button" in the palette. Drag your mouse over
to the Viewer. Drop the button and a new button will appear on the Viewer.
Than Sare
Connect App Inventor to your phone for live testing
One of the neatest things about App Inventor is that you can see and test your app while you're building
it, on a connected device. If you have an Android phone or tablet, follow the steps below. If you do
not have a device, then follow the instructions for setting up the on-screen emulator (opens a new page)
and then come back to this tutorial once you've gotten the emulator connected to App Inventor.
Than Sare
Get the MIT AI2 Companion from the Play Store and install it on your phone or
tablet.
The preferred method for getting the AI2 Companion App is to download the app from the Play Store
by searching for "MIT AI2 Companion".
Than Sare
To download the AI2 Companion App to your device directly (SKIP THIS STEP IF
YOU already got the app from Play Store)
If for some reason you can not connect to the Google Play store, you can download the AI2 Companion
as described here.
First, you will need to go into your phone's settings (#1), choose "Security", then scroll down to allow
"Unknown Sources", which allows apps that are not from the Play Store to be installed on the phone.
Second, do one of the following:
A)Scan the QR code above (#2)
or
B)Click the "Need help finding..." link and you'll be taken to the download page. From there you can
download the MITAI2Companion.apk file to your computer and then move it over to your device to
install it.
Than Sare
Start the AICompanion on your device
On your phone or tablet, click the icon for the MIT AI Companion to start the app. NOTE: Your phone
and computer must both be on the same wireless network. Make sure your phone's wifi is on and
that you are connected to the local wireless network. If you can not connect over wifi, go to the Setup
Instructions on the App Inventor Website to find out how to connect with a USB cable.
Than Sare
Get the Connection Code from App Inventor and scan or type it into your
Companion app
On the Connect menu, choose "AI Companion". You can connect by:
1 - Scanning the QR code by clicking "Scan QR code" (#1).
or
2 - Typing the code into the text window and click "Connect with code" (#2).
Than Sare
See your app on the connected device
You will know that your connection is successful when you see your app on the connected device. So
far our app only has a button, so that is what you will see. As you add more to the project, you will see
your app change on your phone.
Than Sare
Change the Text on the Button
On the properties pane, change the text for the Button. Select the text "Text for Button 1", delete it and
type in "Talk To Me". Notice that the text on your app's button changes right away.
Than Sare
Add a Text-to-Speech component to your app
Go to the Media drawer and drag out a TextToSpeech component. Drop it onto the Viewer. Notice that
it drops down under "Non-visible components" because it is not something that will show up on the
app's user interface. It's more like a tool that is available to the app.
Than Sare
Switch over to the Blocks Editor
It's time to tell your app what to do! Click "Blocks" to move over to the Blocks Editor. Think of the
Designer and Blocks buttons like tabs -- you use them to move back and forth between the two areas of
App Inventor.
Than Sare
The Blocks Editor
The Blocks Editor is where you program the behavior of your app. There are Built-in blocks that handle
things like math, logic, and text. Below that are the blocks that go with each of the components in your
app. In order to get the blocks for a certain component to show up in the Blocks Editor, you first have to
add that component to your app through the Designer.
Than Sare
Make a button click event
Click on the Button1 drawer. Click and hold the when Button1.Click do block. Drag it over to the
workspace and drop it there. This is the block that will handle what happens when the button on your
app is clicked. It is called an "Event Handler".
Than Sare
Program the TextToSpeech action
Click on the TextToSpeech drawer. Click and hold the call TextToSpeech1.Speak block. Drag it over
to the workspace and drop it there. This is the block that will make the phone speak. Because it is
inside the Button.Click, it will run when the button on your app is clicked.
Than Sare
Fill in the message socket on TextToSpeech.Speak Block
Almost done! Now you just need to tell the TextToSpeech.Speak block what to say. To do that, click on
the Text drawer, drag out a text block and plug it into the socket labeled "message".
Specify what the app should say when the button is clicked
Click on the text block and type in "Congratulations! You've made your first app." (Feel free to use any
phrase you like, this is just a suggestion.)
Than Sare
Now test it out!
Go to your connected device and click the button. Make sure your volume is up! You should hear the
phone speak the phrase out loud. (This works even with the emulator.)
Great job!
Now move on to TalkToMe Part 2 to make the app respond to shaking and to let users put in whatever
phrase they want.
Than Sare
TalkToMe Part 2: Shaking and User Input
This tutorial shows you how to extend the basic TalkToMe app so that it responds to shaking, and so
that the user can make the phone say any phrase s/he types in.
Go to App Inventor on the web and log in.
Go to appinventor.mit.edu and click "Create" or log in directly at ai2.appinventor.mit.edu.
Than Sare
Open the "TalkToMe" project that you worked on in the last tutorial.
App Inventor will always open the last project you worked on, so you may automatically be taken into
your TalkToMe app.
Go to the Designer Tab
Your project may open in the Designer. If it does not, click "Designer" in the upper right.
Than Sare
Add an Accelerometer Sensor
In the Sensors drawer, drag out an AccelerometerSensor component and drop it onto the Viewer. (It's
a non-visible component, so it drops to the bottom of the screen.) NOTE: emulator users should skip
this part and proceed to the next section of this tutorial called "Say Anything". (The emulator can not
respond to shaking!)
Than Sare
Go to the Blocks Editor
Click "Blocks" to program the new Accelerometer Sensor that you just added.
Program the Accelerometer Shaking event
Click the AccelerometerSensor1 drawer to see its blocks. Drag out the when
AccelerometerSensor1.Shaking do block and drop it on the workspace.
Than Sare
What do we want the app to do when the accelerometer detects shaking?
Copy and paste the blocks that are currently inside the when Button1.Click event handler. You can
select the purple block, then hit the key combination on your computer to copy and then to paste. You'll
have a second set of blocks to put inside the when Accelerometer.Shaking block.
(Alternatively, you can drag out a new call TextToSpeech1.Speak block from the TextToSpeech
drawer, and a new pink text block from the Text drawer.)
Change the phrase that is spoken when the phone is shaking.
Type in something funny for when the phone responds to shaking.
Than Sare
Test it out!
You can now shake your phone and it should respond by saying "Stop shaking me!" (or whatever
phrase you put in.)
Say Anything
Is your phone talking to you? Cool! Now let's program the button click so that it causes the phone to
speak whatever phrase the user put into the text box. Go back to the Designer.
Than Sare
Add a Text Box to your user interface.
From the User Interface drawer, drag out a TextBox and put it above the Button that is already on the
screen.
Back to the Blocks Editor!
Than Sare
Get the text that is typed into the TextBox.
Get the text property of the TextBox1. The green blocks in the TextBox1 drawer are the "getters" and
"setters" for the TextBox1 component. You want your app to speak out loud whatever is currently in the
TextBox1 Text property (i.e. whatever is typed into the text box). Drag out the TextBox1.Text getter
block.
Than Sare
Set the Button Click event to speak the text that is in the Text Box.
Pull out the "congratulations..." text box and plug in the TextBox1.Text block. You can throw the pink
text block away by dragging it to the trash in the lower right corner of the workspace.
Test your app!
Now your app has two behaviors: When the button is clicked, it will speak out loud whatever words are
currently in the Text Box on the screen. (if nothing is there, it will say nothing.)
The app will also say "Stop Shaking Me" when the phone is shaken.
Than Sare
Congrats! You've built a real app!
Give some thought to what else this app could do. Here are some ideas for extensions:
-Random phrase generator
-Mad Libs - player chooses noun, verb, adjective, adverb, person and it picks one from a list that you
program.
- Magic 8 Ball App
- Name picker - useful for teachers to call on a student
You could also play around with Speech-To-Text. Have fun!
Than Sare
BallBounce: A simple game app
In this tutorial, you will learn about animation in App Inventor by making a Ball (a sprite) bounce around
on the screen (on a Canvas).
Start a New Project
If you have another project open, go to My Projects menu and choose New Project.
Than Sare
Name the Project
Call it something like "BallBounce". Remember, no spaces. But underscores are OK.
Add a Canvas
From the Drawing and Animation drawer, drag out a Canvas component and drop it onto the viewer.
Than Sare
Set the Screen so that it does not scroll
The default setting for App Inventor is that the screen of your app will be "scrollable", which means that
the user interface can go beyond the limit of the screen and the user can scroll down by swiping their
finger (like scrolling on a web page). When you are using a Canvas, you have to turn off the
"Scrollable" setting (UNCHECK THE BOX) so that the screen does not scroll. This will allow you to
make the Canvas to fill up the whole screen.
Than Sare
Change the Height and Width of the Canvas to Fill Parent
Make sure the Canvas component is selected (#1) so that its properties show up in the Properties Pane
(#2). Down at the bottom, set the Height property to "Fill Parent". Do the same with the Width
property.
Than Sare
Add a Ball
Now that we have a Canvas in place, we can add a Ball Sprite. This can also be found in the Drawing
and Animation drawer. Drag out a Ball component and drop it onto the Canvas (#1). If you'd like the
ball to show up better, you can change its Radius property in the Properties pane (#2).
Open the Blocks Editor.
Than Sare
Open the Ball1 Drawer to view the Ball's blocks.
Drag out the Flung Event Handler
Choose the block when Ball1.Flung and drag-and-drop it onto the workspace. Flung refers to the user
making a "Fling gesture" with his/her finger to "fling" the ball. Fling is a gesture like what a golf club
does, not like how you launch Angry Birds! In App Inventor, the event handler for that type of gesture is
called when Flung.
Than Sare
Set the Ball's Heading and Speed. First get the setter blocks.
Open the Ball drawer and scroll down in the list of blocks to get the set Ball1.Heading and set
Ball1.Speed blocks
Than Sare
Plug the set Ball1.Speed and set Ball1.Heading into the Fling event handler
Set the Ball's speed to be the same as the Fling gesture's speed
Mouse over the "speed" parameter of the when Ball1.Flung event handler. The get and set blocks for
the speed of the fling will pop up. Grab the get speed block and plug that into the set Ball1.Speed
block.
App Inventor Beginner Tutorials - 40
Than Sare
Set the Ball's heading to be the same as the Fling gesture's heading
Do the same for the Ball's heading. Mouse over the heading parameter and you'll see the get heading
block appear. Grab that block, and click it into the set Ball1.Heading block.
Than Sare
Test it out
A good habit while building apps is to test while you build. App Inventor lets you do this easily because
you can have a live connection between your phone (or emulator) and the App Inventor development
environment. If you don't have a phone (or emulator) connected, go to the connection instructions and
then come back to this tutorial. (Connection instructions are in Tutorial #1 or on the website under
"Getting Started".)
Why does the Ball get stuck on the side of the screen?!
After flinging your ball across the screen, you probably noticed that it got stuck on the side. This is
because the ball's heading has not changed even though it hit the side of the canvas. To make the ball
"bounce" of the edge of the screen, we can program in a new event handler called "When Edge
Reached".
Than Sare
Add an Edge Reached Event
Go into the Ball1 drawer and pull out a when Ball1.EdgeReached do event.
Than Sare
Go back into the Ball1 drawer and pull out a Ball.Bounce block.
Add the edge value for the Ball.Bounce block
The Ball.Bounce method needs an edge argument. Notice that the Ball1.EdgeReached event has an
"edge" as a parameter. We can take the get edge block from that argument and plug it into the call
Ball1.Bounce method. Grab the get edge block by mousing over (hover your mouse pointer over) the
"edge" parameter on the when Ball1.EdgeReached block.
Than Sare
Your final blocks should look like this. Now test it out!
Than Sare
Test it out!
Now, when you fling the ball, it should bounce off the edges of the canvas. Great job!
There are many ways to extend this app.
Here are some ideas... but the possibilities are endless!
- Change the color of the ball based on how fast it is moving or which edge it reaches.
- Scale the speed of the ball so that it slows down and stops after it gets flung.
- Give the ball obstacles or targets to hit
- Introduce a paddle for intercepting the ball, like a Pong game
Visit the App Inventor website to find tutorials that help you extend this app, particularly the Mini Golf
tutorial.
Have fun with these extensions, or others that you think up!
Than Sare
DigitalDoodle: Drawing App
This tutorial will show you how to draw a line on the screen as the user drags a finger around.
Start a New Project
From the My Projects page, click New Project. If you have another project open, go to My Projects
menu and choose New Project.
Name the Project
Call this project DigitalDoodle, or create your own name for this drawing app.
Than Sare
Set the Screen so that it does not scroll
The default setting for App Inventor is that the screen of your app will be "scrollable", which means that
the user interface can go beyond the limit of the screen and the user can scroll down by swiping their
finger (like scrolling on a web page). When you are using a Canvas, you have to turn off the
"Scrollable" setting (UNCHECK THE BOX) so that the screen does not scroll. This will allow you to
make the Canvas to fill up the whole screen.
Than Sare
Add a Canvas
From the Drawing and Animation drawer, drag out a Canvas component.
Than Sare
Change the Height and Width of the Canvas to Fill Parent
Make sure the Canvas component is selected (#1) so that its properties show up in the Properties Pane
(#2). Down at the bottom, set the Height property to "Fill Parent". Do the same with the Width
property.
That's all for the Designer! Go over to the Blocks.
Believe it or not, for now this app only needs a Canvas. Go into the Blocks Editor to program the app.
Than Sare
Get a Canvas.Dragged event block
In the Canvas1 drawer, pull out the when Canvas1.Dragged event.
Than Sare
Get a Canvas.DrawLine call block
In the Canvas1 drawer, pull out the when Canvas1.DrawLine method block..
Than Sare
Use the get and set blocks from the Dragged block to fill in the values for the
Draw Line block.
The Canvas Dragged event will happen over and over again very rapidly while the user drags a finger
on the screen. Each time that Dragged event block is called, it will draw a small line between the
previous location (prevX, prevY) of the finger to the new location (currentX, currentY). Mouse over the
parameters of the Canvas1.Dragged block to pull out the get blocks that you need. (Mouse over them,
don't click on them.)
Than Sare
Test it out!
Go to your connected device and drag your finger around the screen. Do you see a line?
Great work! Now extend this app
Here are some ideas for extending this app. You can probably think of many more!
- Change the color of the ink (and let the user pick from a selection of colors). See Paint Pot tutorial.
- Change the background to a photograph or picture.
- Let the user draw dots as well as lines (hint: Use DrawCircle block).
- Add a button that turns on the camera and lets the user take a picture and then doodle on it.
Than Sare

More Related Content

What's hot

Emergency androidstudiochapter
Emergency androidstudiochapterEmergency androidstudiochapter
Emergency androidstudiochapterAravindharamanan S
 
A 1 ppt excercis exx
A 1 ppt excercis exxA 1 ppt excercis exx
A 1 ppt excercis exxJOHN WALKER
 
Mobile game testing report
Mobile game testing reportMobile game testing report
Mobile game testing reportQA Madness
 
Construir Aplicações Silverlight para Windows Phone 7
Construir Aplicações Silverlight para Windows Phone 7Construir Aplicações Silverlight para Windows Phone 7
Construir Aplicações Silverlight para Windows Phone 7Comunidade NetPonto
 
Powerpoint tutorial
Powerpoint tutorialPowerpoint tutorial
Powerpoint tutorialtchrxchg
 
IFTTT: If This Then That
IFTTT: If This Then ThatIFTTT: If This Then That
IFTTT: If This Then ThatShashank Kapoor
 
Fernandez a1 tutorial & quiz_2
Fernandez a1 tutorial & quiz_2Fernandez a1 tutorial & quiz_2
Fernandez a1 tutorial & quiz_2karlynf
 
Mobile application testing report
Mobile application testing reportMobile application testing report
Mobile application testing reportQA Madness
 

What's hot (12)

Google App Inventor
Google App InventorGoogle App Inventor
Google App Inventor
 
Alive with activity
Alive with activityAlive with activity
Alive with activity
 
Emergency androidstudiochapter
Emergency androidstudiochapterEmergency androidstudiochapter
Emergency androidstudiochapter
 
A 1 ppt excercis exx
A 1 ppt excercis exxA 1 ppt excercis exx
A 1 ppt excercis exx
 
App inventor
App inventorApp inventor
App inventor
 
Mobile game testing report
Mobile game testing reportMobile game testing report
Mobile game testing report
 
Construir Aplicações Silverlight para Windows Phone 7
Construir Aplicações Silverlight para Windows Phone 7Construir Aplicações Silverlight para Windows Phone 7
Construir Aplicações Silverlight para Windows Phone 7
 
Ladas ppt tutorial
Ladas ppt tutorialLadas ppt tutorial
Ladas ppt tutorial
 
Powerpoint tutorial
Powerpoint tutorialPowerpoint tutorial
Powerpoint tutorial
 
IFTTT: If This Then That
IFTTT: If This Then ThatIFTTT: If This Then That
IFTTT: If This Then That
 
Fernandez a1 tutorial & quiz_2
Fernandez a1 tutorial & quiz_2Fernandez a1 tutorial & quiz_2
Fernandez a1 tutorial & quiz_2
 
Mobile application testing report
Mobile application testing reportMobile application testing report
Mobile application testing report
 

Similar to App Inventor Beginner Tutorials Guide

I have adream
I have adreamI have adream
I have adreamANASZ123
 
App Inventor : Getting Started Guide
App Inventor : Getting Started GuideApp Inventor : Getting Started Guide
App Inventor : Getting Started GuideVasilis Drimtzias
 
Tallerappinventor english
Tallerappinventor englishTallerappinventor english
Tallerappinventor englishlluís nater
 
Taller app inventor english
Taller  app inventor englishTaller  app inventor english
Taller app inventor englishlluís nater
 
window_10_user_guide.pdf
window_10_user_guide.pdfwindow_10_user_guide.pdf
window_10_user_guide.pdfMertin2
 
Windowstechnicalpreviewqg
WindowstechnicalpreviewqgWindowstechnicalpreviewqg
WindowstechnicalpreviewqgAlex Carranza
 
Windows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.comWindows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.comWlademir RS
 
IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st TutorialHassan A-j
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outletsveeracynixit
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outletsveeracynixit
 
Ayw app inventor
Ayw app inventorAyw app inventor
Ayw app inventorpbeerak
 
Work spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guideWork spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guideWilliam McIntosh
 
Work spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guideWork spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guideWilliam McIntosh
 
"Discover windows phone" 05. Application Bar
"Discover windows phone" 05. Application Bar"Discover windows phone" 05. Application Bar
"Discover windows phone" 05. Application BarYasmine Abdelhady
 
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizeroprimeteacher32
 
Tat learning applications en
Tat learning applications enTat learning applications en
Tat learning applications enToni Setyawan
 

Similar to App Inventor Beginner Tutorials Guide (20)

I have adream
I have adreamI have adream
I have adream
 
App Inventor : Getting Started Guide
App Inventor : Getting Started GuideApp Inventor : Getting Started Guide
App Inventor : Getting Started Guide
 
Tallerappinventor english
Tallerappinventor englishTallerappinventor english
Tallerappinventor english
 
Taller app inventor english
Taller  app inventor englishTaller  app inventor english
Taller app inventor english
 
window_10_user_guide.pdf
window_10_user_guide.pdfwindow_10_user_guide.pdf
window_10_user_guide.pdf
 
Windowstechnicalpreviewqg
WindowstechnicalpreviewqgWindowstechnicalpreviewqg
Windowstechnicalpreviewqg
 
Windows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.comWindows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.com
 
Create New Android Layout
Create New Android LayoutCreate New Android Layout
Create New Android Layout
 
IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st Tutorial
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Ayw app inventor
Ayw app inventorAyw app inventor
Ayw app inventor
 
Work spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guideWork spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guide
 
Work spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guideWork spaceconnect 2.0 user guide
Work spaceconnect 2.0 user guide
 
"Discover windows phone" 05. Application Bar
"Discover windows phone" 05. Application Bar"Discover windows phone" 05. Application Bar
"Discover windows phone" 05. Application Bar
 
Os 1
Os 1 Os 1
Os 1
 
Android app development guide for freshers by ace web academy
Android app development guide for freshers  by ace web academyAndroid app development guide for freshers  by ace web academy
Android app development guide for freshers by ace web academy
 
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizero
 
Tat learning applications en
Tat learning applications enTat learning applications en
Tat learning applications en
 
Using android's action bar
Using android's action barUsing android's action bar
Using android's action bar
 

More from than sare

Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4than sare
 
Project Management_Review_2018
Project Management_Review_2018Project Management_Review_2018
Project Management_Review_2018than sare
 
Android review_for final Semester II of Year4
Android review_for final Semester II of Year4Android review_for final Semester II of Year4
Android review_for final Semester II of Year4than sare
 
Importain questions e_commerce_preview questions
Importain questions e_commerce_preview questionsImportain questions e_commerce_preview questions
Importain questions e_commerce_preview questionsthan sare
 
E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018than sare
 
Physic grade-12
Physic grade-12Physic grade-12
Physic grade-12than sare
 
Business plan
Business planBusiness plan
Business planthan sare
 
Share point review qustions
Share point review qustionsShare point review qustions
Share point review qustionsthan sare
 
Share point answer the question
Share point answer the questionShare point answer the question
Share point answer the questionthan sare
 
Judging rubric
Judging rubricJudging rubric
Judging rubricthan sare
 
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)than sare
 
Database(db sql) review
Database(db sql) reviewDatabase(db sql) review
Database(db sql) reviewthan sare
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)than sare
 
Answer ado.net pre-exam2018
Answer ado.net pre-exam2018Answer ado.net pre-exam2018
Answer ado.net pre-exam2018than sare
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and oodthan sare
 
Technovation week6 planning_yourcode
Technovation week6 planning_yourcodeTechnovation week6 planning_yourcode
Technovation week6 planning_yourcodethan sare
 
Sen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansareSen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansarethan sare
 
Week5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than SareWeek5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than Sarethan sare
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)than sare
 

More from than sare (20)

Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4
 
Project Management_Review_2018
Project Management_Review_2018Project Management_Review_2018
Project Management_Review_2018
 
Android review_for final Semester II of Year4
Android review_for final Semester II of Year4Android review_for final Semester II of Year4
Android review_for final Semester II of Year4
 
Importain questions e_commerce_preview questions
Importain questions e_commerce_preview questionsImportain questions e_commerce_preview questions
Importain questions e_commerce_preview questions
 
E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018
 
Physic 12-2
Physic 12-2Physic 12-2
Physic 12-2
 
Physic grade-12
Physic grade-12Physic grade-12
Physic grade-12
 
Business plan
Business planBusiness plan
Business plan
 
Share point review qustions
Share point review qustionsShare point review qustions
Share point review qustions
 
Share point answer the question
Share point answer the questionShare point answer the question
Share point answer the question
 
Judging rubric
Judging rubricJudging rubric
Judging rubric
 
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)
 
Database(db sql) review
Database(db sql) reviewDatabase(db sql) review
Database(db sql) review
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)
 
Answer ado.net pre-exam2018
Answer ado.net pre-exam2018Answer ado.net pre-exam2018
Answer ado.net pre-exam2018
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and ood
 
Technovation week6 planning_yourcode
Technovation week6 planning_yourcodeTechnovation week6 planning_yourcode
Technovation week6 planning_yourcode
 
Sen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansareSen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansare
 
Week5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than SareWeek5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than Sare
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)
 

Recently uploaded

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Recently uploaded (20)

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 

App Inventor Beginner Tutorials Guide

  • 1. App Inventor Beginner Tutorials Than Sare
  • 2. 1 Four Simple Tutorials for Getting Started with App Inventor 1. TalkToMe: Your first App Inventor app 2. TalkToMe Part 2: Shaking and User Input 3. BallBounce: A simple game app 4. DigitalDoodle: Drawing App 4 23 33 47 Than Sare
  • 3. Four Simple Tutorials for Getting Started with App Inventor Than Sare
  • 4. TalkToMe: Your first App Inventor app This step-by-step picture tutorial will guide you through making a talking app. To get started, go to App Inventor on the web. Go directly to ai2.appinventor.mit.edu, or click the orange "Create" button from the App Inventor website. Than Sare
  • 5. Log in to App Inventor with a gmail (or google) user name and password. Use an existing gmail account or school-based google account to log in to ai2.appinventor.mit.edu To set up a brand new gmail account, go to accounts.google.com/SignUp Than Sare
  • 6. Click "Continue" to dismiss the splash screen. Than Sare
  • 7. Start a new project. Name the project "TalkToMe" (no spaces!) Type in the project name (underscores are allowed, spaces are not) and click OK. Than Sare
  • 8. You are now in the Designer, where you lay out the "user interface" of your app. The Design Window, or simply "Designer" is where you lay out the look and feel of your app, and specify what functionalities it should have. You choose things for the user interface things like Buttons, Images, and Text boxes, and functionalities like Text-to-Speech, Sensors, and GPS. Add a Button Our project needs a button. Click and hold on the word "Button" in the palette. Drag your mouse over to the Viewer. Drop the button and a new button will appear on the Viewer. Than Sare
  • 9. Connect App Inventor to your phone for live testing One of the neatest things about App Inventor is that you can see and test your app while you're building it, on a connected device. If you have an Android phone or tablet, follow the steps below. If you do not have a device, then follow the instructions for setting up the on-screen emulator (opens a new page) and then come back to this tutorial once you've gotten the emulator connected to App Inventor. Than Sare
  • 10. Get the MIT AI2 Companion from the Play Store and install it on your phone or tablet. The preferred method for getting the AI2 Companion App is to download the app from the Play Store by searching for "MIT AI2 Companion". Than Sare
  • 11. To download the AI2 Companion App to your device directly (SKIP THIS STEP IF YOU already got the app from Play Store) If for some reason you can not connect to the Google Play store, you can download the AI2 Companion as described here. First, you will need to go into your phone's settings (#1), choose "Security", then scroll down to allow "Unknown Sources", which allows apps that are not from the Play Store to be installed on the phone. Second, do one of the following: A)Scan the QR code above (#2) or B)Click the "Need help finding..." link and you'll be taken to the download page. From there you can download the MITAI2Companion.apk file to your computer and then move it over to your device to install it. Than Sare
  • 12. Start the AICompanion on your device On your phone or tablet, click the icon for the MIT AI Companion to start the app. NOTE: Your phone and computer must both be on the same wireless network. Make sure your phone's wifi is on and that you are connected to the local wireless network. If you can not connect over wifi, go to the Setup Instructions on the App Inventor Website to find out how to connect with a USB cable. Than Sare
  • 13. Get the Connection Code from App Inventor and scan or type it into your Companion app On the Connect menu, choose "AI Companion". You can connect by: 1 - Scanning the QR code by clicking "Scan QR code" (#1). or 2 - Typing the code into the text window and click "Connect with code" (#2). Than Sare
  • 14. See your app on the connected device You will know that your connection is successful when you see your app on the connected device. So far our app only has a button, so that is what you will see. As you add more to the project, you will see your app change on your phone. Than Sare
  • 15. Change the Text on the Button On the properties pane, change the text for the Button. Select the text "Text for Button 1", delete it and type in "Talk To Me". Notice that the text on your app's button changes right away. Than Sare
  • 16. Add a Text-to-Speech component to your app Go to the Media drawer and drag out a TextToSpeech component. Drop it onto the Viewer. Notice that it drops down under "Non-visible components" because it is not something that will show up on the app's user interface. It's more like a tool that is available to the app. Than Sare
  • 17. Switch over to the Blocks Editor It's time to tell your app what to do! Click "Blocks" to move over to the Blocks Editor. Think of the Designer and Blocks buttons like tabs -- you use them to move back and forth between the two areas of App Inventor. Than Sare
  • 18. The Blocks Editor The Blocks Editor is where you program the behavior of your app. There are Built-in blocks that handle things like math, logic, and text. Below that are the blocks that go with each of the components in your app. In order to get the blocks for a certain component to show up in the Blocks Editor, you first have to add that component to your app through the Designer. Than Sare
  • 19. Make a button click event Click on the Button1 drawer. Click and hold the when Button1.Click do block. Drag it over to the workspace and drop it there. This is the block that will handle what happens when the button on your app is clicked. It is called an "Event Handler". Than Sare
  • 20. Program the TextToSpeech action Click on the TextToSpeech drawer. Click and hold the call TextToSpeech1.Speak block. Drag it over to the workspace and drop it there. This is the block that will make the phone speak. Because it is inside the Button.Click, it will run when the button on your app is clicked. Than Sare
  • 21. Fill in the message socket on TextToSpeech.Speak Block Almost done! Now you just need to tell the TextToSpeech.Speak block what to say. To do that, click on the Text drawer, drag out a text block and plug it into the socket labeled "message". Specify what the app should say when the button is clicked Click on the text block and type in "Congratulations! You've made your first app." (Feel free to use any phrase you like, this is just a suggestion.) Than Sare
  • 22. Now test it out! Go to your connected device and click the button. Make sure your volume is up! You should hear the phone speak the phrase out loud. (This works even with the emulator.) Great job! Now move on to TalkToMe Part 2 to make the app respond to shaking and to let users put in whatever phrase they want. Than Sare
  • 23. TalkToMe Part 2: Shaking and User Input This tutorial shows you how to extend the basic TalkToMe app so that it responds to shaking, and so that the user can make the phone say any phrase s/he types in. Go to App Inventor on the web and log in. Go to appinventor.mit.edu and click "Create" or log in directly at ai2.appinventor.mit.edu. Than Sare
  • 24. Open the "TalkToMe" project that you worked on in the last tutorial. App Inventor will always open the last project you worked on, so you may automatically be taken into your TalkToMe app. Go to the Designer Tab Your project may open in the Designer. If it does not, click "Designer" in the upper right. Than Sare
  • 25. Add an Accelerometer Sensor In the Sensors drawer, drag out an AccelerometerSensor component and drop it onto the Viewer. (It's a non-visible component, so it drops to the bottom of the screen.) NOTE: emulator users should skip this part and proceed to the next section of this tutorial called "Say Anything". (The emulator can not respond to shaking!) Than Sare
  • 26. Go to the Blocks Editor Click "Blocks" to program the new Accelerometer Sensor that you just added. Program the Accelerometer Shaking event Click the AccelerometerSensor1 drawer to see its blocks. Drag out the when AccelerometerSensor1.Shaking do block and drop it on the workspace. Than Sare
  • 27. What do we want the app to do when the accelerometer detects shaking? Copy and paste the blocks that are currently inside the when Button1.Click event handler. You can select the purple block, then hit the key combination on your computer to copy and then to paste. You'll have a second set of blocks to put inside the when Accelerometer.Shaking block. (Alternatively, you can drag out a new call TextToSpeech1.Speak block from the TextToSpeech drawer, and a new pink text block from the Text drawer.) Change the phrase that is spoken when the phone is shaking. Type in something funny for when the phone responds to shaking. Than Sare
  • 28. Test it out! You can now shake your phone and it should respond by saying "Stop shaking me!" (or whatever phrase you put in.) Say Anything Is your phone talking to you? Cool! Now let's program the button click so that it causes the phone to speak whatever phrase the user put into the text box. Go back to the Designer. Than Sare
  • 29. Add a Text Box to your user interface. From the User Interface drawer, drag out a TextBox and put it above the Button that is already on the screen. Back to the Blocks Editor! Than Sare
  • 30. Get the text that is typed into the TextBox. Get the text property of the TextBox1. The green blocks in the TextBox1 drawer are the "getters" and "setters" for the TextBox1 component. You want your app to speak out loud whatever is currently in the TextBox1 Text property (i.e. whatever is typed into the text box). Drag out the TextBox1.Text getter block. Than Sare
  • 31. Set the Button Click event to speak the text that is in the Text Box. Pull out the "congratulations..." text box and plug in the TextBox1.Text block. You can throw the pink text block away by dragging it to the trash in the lower right corner of the workspace. Test your app! Now your app has two behaviors: When the button is clicked, it will speak out loud whatever words are currently in the Text Box on the screen. (if nothing is there, it will say nothing.) The app will also say "Stop Shaking Me" when the phone is shaken. Than Sare
  • 32. Congrats! You've built a real app! Give some thought to what else this app could do. Here are some ideas for extensions: -Random phrase generator -Mad Libs - player chooses noun, verb, adjective, adverb, person and it picks one from a list that you program. - Magic 8 Ball App - Name picker - useful for teachers to call on a student You could also play around with Speech-To-Text. Have fun! Than Sare
  • 33. BallBounce: A simple game app In this tutorial, you will learn about animation in App Inventor by making a Ball (a sprite) bounce around on the screen (on a Canvas). Start a New Project If you have another project open, go to My Projects menu and choose New Project. Than Sare
  • 34. Name the Project Call it something like "BallBounce". Remember, no spaces. But underscores are OK. Add a Canvas From the Drawing and Animation drawer, drag out a Canvas component and drop it onto the viewer. Than Sare
  • 35. Set the Screen so that it does not scroll The default setting for App Inventor is that the screen of your app will be "scrollable", which means that the user interface can go beyond the limit of the screen and the user can scroll down by swiping their finger (like scrolling on a web page). When you are using a Canvas, you have to turn off the "Scrollable" setting (UNCHECK THE BOX) so that the screen does not scroll. This will allow you to make the Canvas to fill up the whole screen. Than Sare
  • 36. Change the Height and Width of the Canvas to Fill Parent Make sure the Canvas component is selected (#1) so that its properties show up in the Properties Pane (#2). Down at the bottom, set the Height property to "Fill Parent". Do the same with the Width property. Than Sare
  • 37. Add a Ball Now that we have a Canvas in place, we can add a Ball Sprite. This can also be found in the Drawing and Animation drawer. Drag out a Ball component and drop it onto the Canvas (#1). If you'd like the ball to show up better, you can change its Radius property in the Properties pane (#2). Open the Blocks Editor. Than Sare
  • 38. Open the Ball1 Drawer to view the Ball's blocks. Drag out the Flung Event Handler Choose the block when Ball1.Flung and drag-and-drop it onto the workspace. Flung refers to the user making a "Fling gesture" with his/her finger to "fling" the ball. Fling is a gesture like what a golf club does, not like how you launch Angry Birds! In App Inventor, the event handler for that type of gesture is called when Flung. Than Sare
  • 39. Set the Ball's Heading and Speed. First get the setter blocks. Open the Ball drawer and scroll down in the list of blocks to get the set Ball1.Heading and set Ball1.Speed blocks Than Sare
  • 40. Plug the set Ball1.Speed and set Ball1.Heading into the Fling event handler Set the Ball's speed to be the same as the Fling gesture's speed Mouse over the "speed" parameter of the when Ball1.Flung event handler. The get and set blocks for the speed of the fling will pop up. Grab the get speed block and plug that into the set Ball1.Speed block. App Inventor Beginner Tutorials - 40 Than Sare
  • 41. Set the Ball's heading to be the same as the Fling gesture's heading Do the same for the Ball's heading. Mouse over the heading parameter and you'll see the get heading block appear. Grab that block, and click it into the set Ball1.Heading block. Than Sare
  • 42. Test it out A good habit while building apps is to test while you build. App Inventor lets you do this easily because you can have a live connection between your phone (or emulator) and the App Inventor development environment. If you don't have a phone (or emulator) connected, go to the connection instructions and then come back to this tutorial. (Connection instructions are in Tutorial #1 or on the website under "Getting Started".) Why does the Ball get stuck on the side of the screen?! After flinging your ball across the screen, you probably noticed that it got stuck on the side. This is because the ball's heading has not changed even though it hit the side of the canvas. To make the ball "bounce" of the edge of the screen, we can program in a new event handler called "When Edge Reached". Than Sare
  • 43. Add an Edge Reached Event Go into the Ball1 drawer and pull out a when Ball1.EdgeReached do event. Than Sare
  • 44. Go back into the Ball1 drawer and pull out a Ball.Bounce block. Add the edge value for the Ball.Bounce block The Ball.Bounce method needs an edge argument. Notice that the Ball1.EdgeReached event has an "edge" as a parameter. We can take the get edge block from that argument and plug it into the call Ball1.Bounce method. Grab the get edge block by mousing over (hover your mouse pointer over) the "edge" parameter on the when Ball1.EdgeReached block. Than Sare
  • 45. Your final blocks should look like this. Now test it out! Than Sare
  • 46. Test it out! Now, when you fling the ball, it should bounce off the edges of the canvas. Great job! There are many ways to extend this app. Here are some ideas... but the possibilities are endless! - Change the color of the ball based on how fast it is moving or which edge it reaches. - Scale the speed of the ball so that it slows down and stops after it gets flung. - Give the ball obstacles or targets to hit - Introduce a paddle for intercepting the ball, like a Pong game Visit the App Inventor website to find tutorials that help you extend this app, particularly the Mini Golf tutorial. Have fun with these extensions, or others that you think up! Than Sare
  • 47. DigitalDoodle: Drawing App This tutorial will show you how to draw a line on the screen as the user drags a finger around. Start a New Project From the My Projects page, click New Project. If you have another project open, go to My Projects menu and choose New Project. Name the Project Call this project DigitalDoodle, or create your own name for this drawing app. Than Sare
  • 48. Set the Screen so that it does not scroll The default setting for App Inventor is that the screen of your app will be "scrollable", which means that the user interface can go beyond the limit of the screen and the user can scroll down by swiping their finger (like scrolling on a web page). When you are using a Canvas, you have to turn off the "Scrollable" setting (UNCHECK THE BOX) so that the screen does not scroll. This will allow you to make the Canvas to fill up the whole screen. Than Sare
  • 49. Add a Canvas From the Drawing and Animation drawer, drag out a Canvas component. Than Sare
  • 50. Change the Height and Width of the Canvas to Fill Parent Make sure the Canvas component is selected (#1) so that its properties show up in the Properties Pane (#2). Down at the bottom, set the Height property to "Fill Parent". Do the same with the Width property. That's all for the Designer! Go over to the Blocks. Believe it or not, for now this app only needs a Canvas. Go into the Blocks Editor to program the app. Than Sare
  • 51. Get a Canvas.Dragged event block In the Canvas1 drawer, pull out the when Canvas1.Dragged event. Than Sare
  • 52. Get a Canvas.DrawLine call block In the Canvas1 drawer, pull out the when Canvas1.DrawLine method block.. Than Sare
  • 53. Use the get and set blocks from the Dragged block to fill in the values for the Draw Line block. The Canvas Dragged event will happen over and over again very rapidly while the user drags a finger on the screen. Each time that Dragged event block is called, it will draw a small line between the previous location (prevX, prevY) of the finger to the new location (currentX, currentY). Mouse over the parameters of the Canvas1.Dragged block to pull out the get blocks that you need. (Mouse over them, don't click on them.) Than Sare
  • 54. Test it out! Go to your connected device and drag your finger around the screen. Do you see a line? Great work! Now extend this app Here are some ideas for extending this app. You can probably think of many more! - Change the color of the ink (and let the user pick from a selection of colors). See Paint Pot tutorial. - Change the background to a photograph or picture. - Let the user draw dots as well as lines (hint: Use DrawCircle block). - Add a button that turns on the camera and lets the user take a picture and then doodle on it. Than Sare