week # 03 Visual Programming Variables Canvas Screen Arrangement

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Create a Simple Game in Scratch
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Presented at : CS4HS University of Massachusetts Lowell Kelly Powers, AMSA Charter School, Mark Sherman, UML, Fred Martin, UML, June 27 th, 2011 Portions.
Chapter 2. Paint Pot We will build the Paint Pot app in class. Notes regarding the screen/user interface: 1.7 buttons and a canvas 2.The canvas has a picture.
靜宜大學資管系 楊子青 1 Programming Your App’s Memory 靜宜大學資管系 楊子青
App Inventor Barb Ericson July 3, 2013.
The Creative Art of Programming © Copyright 2014 Barbara Ann Walters. All Rights Reserved.
App Inventor Barb Ericson Georgia Tech
Starting AppInventor in the Classroom Dale CAS Conference June 2011.
Ch 14. Understanding an App’s Architecture Two perspectives 1.Programmer: a)Components & Behaviour b)Designed in Component designer Blocks editor 2.End-user:
Programing App Inventor. Variable Declaration App Inventor: Declare Variables using the “Define Variable As” Block – Find the Blocks Editor (top-left),
Android Apps: Building Blocks Module 6, Intro to I.T., Fall 2011 Sam Scott.
SCERSIG: Creating Android Apps with App Inventor 26 October 2011 Ric Paul, Health Services Library, Southampton.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Creating Mobile Apps with App Inventor! Day 5 Google search Kris Gordon Ludlow for links.
Quadratic Equation Solver Tutorial. Introduction We will be making an app to solve 2 nd level polynomials like ax 2 +bx+c. We will model our app upon.
Android Apps: Look and Feel Module 6, Intro to I.T., Fall 2011 Sam Scott.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
CS 104 October 26, 2011 App Inventor. Agenda Discuss guest speakers Discuss quiz Finish Paint Pot Discuss concepts from Chapters 2 & 3 Mole Mash (if time.
Intro to AppInventor Dr. Dante Ciolfi (chawl fee).
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
COMPREHENSIVE Windows Tutorial 7 Managing Multimedia Files.
App Inventor MIT App Inventor.
Hack Day. Welcome to Hack Day! Meet your mentor and your teammates! Share: –What’s your name? –What school do you go to (or company do you work for)?
Quick guide on making PowerPoint slides  PowerPoint is a presentation program  A PowerPoint slideshow is a stack of slides being presented one after.
MIT AI DEMO Start New Program Name “My First Program”
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
App Inventor for Android 唐健恒. Outline About App Inventor Getting started Tutorials Reference Documentation  Component Reference  Blocks Reference.
Lesson 1 – Getting Started with App Inventor
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
PowerPoint Project 1 These instructions will tell you what TAB you need to go to, but will not give you pictures of the COMMAND buttons you need. 1.Go.
 Learn the mechanics of using App Inventor to build apps.  Learn how to design an app’s user interface with the App Inventor Designer, and its behavior.
Whittier STEM Fair 2016 CARLI PECORARO’S ANDROID APP PROJECT.
WELCOME TO HEALTH MRS. HOCKLANDER. Agenda 1.Seating chart – nicknames? 2.iPad intro 3.Get iPads 4.Introduce Seesaw 5.Put iPads away.
Introduction to App Inventor 2 ASFA AP CS Principles
North Attleboro High School
Create a Halloween Computer Game in Scratch
Weebly Elements, Continued
Scratch for Interactivity
Getting to Know ArcGIS Chapter 3 Interacting with maps
Microsoft Expression Web 2
Procedures, Simple Expressions
Visual Programming week # 01
Visual Programming week # 02 APP (Application) Architecture.
Starting AppInventor in the Classroom
Android Layouts 24 July 2018 S.RENUKADEVI/AP/SCD/ANDROID LAYOUTS 1.
App Inventor Want to learn how to make mobile apps for your Android phone or tablet?
Chapter 16 – Programming your App’s Memory
Completing the tasks for A452 with….
Visual Programming week # 06
Introduction to TouchDevelop
AIRWays Benchmark Previewing System
Windows Tutorial 7 Managing Multimedia Files
Visual Programming Week # 11
Visual Programming Week # 10
Introduction to AppInventor
Microsoft power point First step File menu Edit menu View menu
Programming Lists of Data 靜宜大學資管系 楊子青
Educational Applications of Technology By: Samantha Evans
Visual Programming week # 05 Lists Quiz Tutorial.
Creating a Simple Game in Scratch
Visual Programming week # 14 Review for Final Exam.
Visual Programming Week # 13
Visual Programming Week # 07
Visual Programming Week # 12
Executive Reports, Instructions and Documentation
How to give Student Voice Surveys
Presentation transcript:

week # 03 Visual Programming Variables Canvas Screen Arrangement Event Handler

Outline 1. APP development 2. Tutorial(Class Project) # 03: PaintPot Simple 3. Variables, Canvas 4. Tutorial(Class Project) # 04: PaintPot Advanced 5. Homework #02 VP Lecture Note by Dr. Hanh Pham 2

APP development

The PROBLEM (requirements): Tutorial # 03: “Paint Pot” The PROBLEM (requirements):  have 3 color buttons, so that user can select the paint color  display a picture, so that user can paint on it  have 4 buttons to: o Take Picture o Wipe o Set the brush size Small o Set the brush size Big VP Lecture Note by Dr. Hanh Pham 4

Tutorial # 03: “Paint Pot” The DESIGN: • User interface: 7 buttons and a picture on a canvas, as shown in the picture Event User Action APP response 1,2,3 Click on Red,Green, Set the paint COLOR to or Blue button Red,Green, or Blue 4 Click on Small Dots Set the size of the DOT to 3 button pixel 5 Click on Big Dots Set the size of the DOT to 7 button pixel 6 CLICK on the Display a DOT at that position CANVAS (picture) 7 DRAG on the Display DOTs on the DRAG path 8 Click on Wipe Remove ALL dots on the button CANVAS 9 Click on Take Use phone CAMERA to take Picture button picture & display it on CANVAS 5 VP Lecture Note by Dr. Hanh Pham

Tutorial # 03: “Paint Pot” INSTRUCTIONS to Build: http://appinventor.mit.edu/explore/ai2/paintpot-part1.html 1) Login to your account at: http://ai2.appinventor.mit.edu 2) Create a new project called “t3_PaintPot” 3) In DESIGN window, add components: 7 buttons, Canvas, a picture, and a Camera 4) Use “Screen Arrangement” to place the buttons 5) RENAME the buttons VP Lecture Note by Dr. Hanh Pham 6

Tutorial # 03: “Paint Pot” In DESIGN window add these components: VP Lecture Note by Dr. Hanh Pham 7

Tutorial # 03: “Paint Pot” SIMPLE INCREMENTAL: FIRST build a SMIPLIER version with LESS events: The PROBLEM (for SIMPLE):  have 3 color buttons, user can select RED for the paint color  use a FIXED size for a DOT  display a picture, so that user can paint on it (only CLICK not drag yet)  have 4 buttons to: o Take Picture o Wipe o Set the brush size Small o Set the brush size Big VP Lecture Note by Dr. Hanh Pham 8

INCREMENTAL: FIRST build a SMIPLIER version with LESS events: Tutorial # 03: “Paint Pot” SIMPLE INCREMENTAL: FIRST build a SMIPLIER version with LESS events: Event User Action APP response 1,2,3 Click on Red,Green, or Set the paint COLOR to Red,Green, or Blue Blue button 4 Click on Small Dots button Set the size of the DOT to 3 pixel 5 Click on Big Dots button Set the size of the DOT to 7 pixel 6 CLICK on the CANVAS Display a DOT at that position (picture) 7 DRAG on the CANVAS Display DOTs on the DRAG path 8 Click on Wipe button Remove ALL dots on the CANVAS 9 Click on Take Picture Use phone CAMERA to take picture & button display it on CANVAS VP Lecture Note by Dr. Hanh Pham 9

Tutorial # 03: “Paint Pot” SIMPLE In Block EDITOR window make these connections: VP Lecture Note by Dr. Hanh Pham 10

Tutorial # 03: “Paint Pot” SIMPLE INCREMENTAL: NOW + do the same for GREEN and BLUE buttons + add the event handler(blocks) for WIPE button The PROBLEM (for SIMPLE):  have 3 color buttons, so that user can select the paint color  display a picture, so that user can paint on it (only CLICK not drag yet)  use a FIXED size for a DOT  have 4 buttons to: o Take Picture o Wipe o Set the brush size Small o Set the brush size Big VP Lecture Note by Dr. Hanh Pham 11

Tutorial # 03: “Paint Pot” SIMPLE In Block EDITOR window ADD these blocks and connections: VP Lecture Note by Dr. Hanh Pham 12

Tutorial # 03: “Paint Pot” ADVANCED INCREMENTAL: NEXT + add the event handler(blocks) for painting LINE with a DRAG The PROBLEM (for SIMPLE):  have 3 color buttons, so that user can select the paint color  use a FIXED size for a DOT  display a picture, so that user can paint on it with a TOUCH/CLICK  user can paint LINE with a DRAG  have 4 buttons to: o Take Picture o Wipe o Set the brush size Small o Set the brush size Big VP Lecture Note by Dr. Hanh Pham 13

Variables it right at (X,Y) position VARIABLEs:  Variable X stores coordinate X of the TOUCHED position  Variable Y stores coordinate Y of the TOUCHED position In this case X and Y are created automatically and received the values WHEN the user TOUCHED the canvas (that’s why X,Y are plugged to DrawingCanvas.Touched) THEN, when we draw the DOT(circle) we should draw it right at (X,Y) position THAT MEANS we need to plug these VALUES and to DrawingCanvas.DrawC VP Lecture Note by Dr. Hanh Pham 14

Variables VARIABLEs: Where to get the VALUE of a variable?  Click on “Variables” under “Built-in” you’ll see:  Drag it to the working area Difference between: and ?  use it when you’d like to WRITE a value(let’s say 5) to X  use it when you’d like to READ a value(let’s say 5) from X VP Lecture Note by Dr. Hanh Pham 15

Canvas + buttons don’t care about where users click. Canvas DO care ! + can detect user TOUCH, record the touched position(x,y) + can detect user DRAG, record the dragged positions: (prevX,prevY) to (currentX,currentY) VP Lecture Note by Dr. Hanh Pham 16

Tutorial # 03: “Paint Pot” ADVANCED INCREMENTAL: LAST + declare a global VARIABLE “dotSize” + add the event handler(blocks) for BigDots button + add the event handler(blocks) for SmallDots button The PROBLEM (for SIMPLE):  have 3 color buttons, so that user can select the paint color  use a FIXED size for a DOT  display a picture, so that user can paint on it with a TOUCH/CLICK  user can paint LINE with a DRAG  have 4 buttons to: o Take Picture o Wipe o Set the brush size Small o Set the brush size Big VP Lecture Note by Dr. Hanh Pham 20

Tutorial # 03: “Paint Pot” ADVANCED In Block EDITOR window ADD blocks to let user SELECT the DOT SIZE: VP Lecture Note by Dr. Hanh Pham 21

Tutorial # 03: “Paint Pot” ADVANCED In Block EDITOR window ADD these blocks and connections: P Lecture Note by Dr. Hanh Pham 17

Tutorial # 03: “Paint Pot” ADVANCED INCREMENTAL: NEXT + add the event handler(blocks) for Taking Picture The PROBLEM (for SIMPLE):  have 3 color buttons, so that user can select the paint color  use a FIXED size for a DOT  display a picture, so that user can paint on it with a TOUCH/CLICK  user can paint LINE with a DRAG  have 4 buttons to: o Take Picture o Wipe o Set the brush size Small o Set the brush size Big VP Lecture Note by Dr. Hanh Pham 18

Tutorial # 03: “Paint Pot” ADVANCED In Block EDITOR window ADD these blocks for “Take Picture” button: VP Lecture Note by Dr. Hanh Pham 19

The PROBLEM (requirements): Homework # 02: “My Dots” The PROBLEM (requirements):  have 5 color buttons, so that user can select the paint color  display a blank white picture(White Board), so that user can put dots (touch) on it  have 3 buttons to let user to: o Take Picture o Wipe all dots o Switch to White Board  has a textbox so that the user can type a text in and a button to print that text on the canvas VP Lecture Note by Dr. Hanh Pham 25

Homework # 02: “My Dots” In DESIGN window add these components: VP Lecture Note by Dr. Hanh Pham 26

Homework # 02: “My Dots” In Block EDITOR window ADD these blocks and connections: VP Lecture Note by Dr. Hanh Pham 27

Homework # 02: “My Dots” EXTRA:  Keep all features of Tutorial #3 (Drag, set Dot size)  Try to find a way to set the font size for the printed text ?  Let the user set the font size (create another textbox for users to enter a font size) ?  Play some sound when user click on Wipe button  … VP Lecture Note by Dr. Hanh Pham 28

References These slides contain materials from many sources including the following: • http://www.appinventor.org http://appinventor.mit.edu “App Inventor: Create Your Own Android Apps” by David Wolber, Hal Abelson, Ellen Spertus, Liz Looney, Publisher: O'Reilly App Inventor for Android: Build Your Own Apps - No Experience Required, Jason Tyler • VP Lecture Note by Dr. Hanh Pham 31