Or working offline with the local server: Once you have the App Inventor running type into your browser http://localhost:8888



Similar documents
App Inventor Tutorial 11 QR Code Reader

App Inventor Drum Machine Instructions (Project #1) (Version 2 of App Inventor) Description:

App Inventor Tutorial 4 Cat & Mouse Game

Mobile Apps with App Inventor

American Sign Language Alphabet App (Project #2) (Version 2 of App Inventor) Description:

Presidents Quiz. What You ll Learn

FrontPage 2003: Forms

App Inventor 2 Workbook. Quiz Development

Terminal Four. Content Management System. Moderator Access

Microsoft Access Rollup Procedure for Microsoft Office Click on Blank Database and name it something appropriate.

OUTLOOK EXPRESS ACCOUNT SETUP FOR USE WITH ELLIPSE ADVANCED SPAM FILTER

Mobile Programming (MIT App Inventor 2)

Setting Sharing Permissions for Google Docs and Google Sites

App Inventor Beginner Tutorials

Lab: Data Backup and Recovery in Windows XP

CHAPTER 8 Presidents Quiz

Introduction to Android Programming

Making the Most of Files & Folders. Schoolwires Centricity2

Basic Pivot Tables. To begin your pivot table, choose Data, Pivot Table and Pivot Chart Report. 1 of 18

Drive. Etobicoke-Mimico Watershed Coalition

TalkToMe Part 2: Shaking and User Input

Lab - Data Backup and Recovery in Windows XP

Intellect Platform - Tables and Templates Basic Document Management System - A101

Xylophone. What You ll Build

DESIGNING YOUR WEBSITE. The following guide will show you how to setup your music website using

Livezilla How to Install on Shared Hosting By: Jon Manning

FORM SIMPLICITY QUICK REFERENCE GUIDE PROFESSIONAL/ULTIMATE EDITION

5.6.2 Optional Lab: Restore Points in Windows Vista

Rational Quality Manager. Quick Start Tutorial

Using Adobe Dreamweaver CS4 (10.0)

TalkToMe: A beginner App Inventor app

Avery Wizard: Using the wizard with Microsoft Word. This is a simple step-by-step guide showing how to use the Avery wizard in word

GOOGLE DOCS APPLICATION WORK WITH GOOGLE DOCUMENTS

GadgetTrak Mobile Security Android & BlackBerry Installation & Operation Manual

Working with Office Applications and ProjectWise

Option nv, Gaston Geenslaan 14, B-3001 Leuven Tel Fax Page 1 of 14

Tutorial on Building a web Application with Jdeveloper using EJB, JPA and Java Server Faces By Phaninder Surapaneni

PaintPot. Figure 2-1. The PaintPot app

Oracle 10G Form Builder and Report Builder

Windows XP Exchange Client Installation Instructions

Named Memory Slots. Properties. CHAPTER 16 Programming Your App s Memory

Table of Contents. Welcome Login Password Assistance Self Registration Secure Mail Compose Drafts...

Automatic Setup... 1 Manual Setup... 2 Installing the Wireless Certificates... 18

VPN clients configuration for Windows 98SE - for Library access

CHAPTER 1 HelloPurr. The chapter covers the following topics:

Information Technology Solutions

I Have a Dream, a Two-Part Introductory Tutorial

1.5 MONITOR. Schools Accountancy Team INTRODUCTION

Volume FIRST WALKTHROUGH. The 10-Minute Guide to Using Newsletter Services. First Walkthrough: the 10-Minute Guide

Infor Xtreme Browser References

Adding Links to Resources

What You ll Build. CHAPTER 3 MoleMash

ClickView Digital Signage User Manual

Hello Purr. What You ll Learn

Creating Database Model Diagrams in Microsoft Visio Jeffery S. Horsburgh

NAS 221 Remote Access Using Cloud Connect TM

Online Statements. About this guide. Important information

Microsoft Office 365 Portal

Tutorial: Creating a form that s the results to you.

WebSphere Business Monitor V6.2 KPI history and prediction lab

Unique promotion code

VP-ASP Shopping Cart Quick Start (Free Version) Guide Version 6.50 March

TRIM: Web Tool. Web Address The TRIM web tool can be accessed at:

Remote Desktop Windows 7 & Windows XP

Recreate your Newsletter Content and Layout within Informz (Workshop) Monica Capogna and Dan Reade. Exercise: Creating two types of Story Layouts

Generating Open For Business Reports with the BIRT RCP Designer

Creating a New Search

Using Windows Task Scheduler instead of the Backup Express Scheduler

User Guide. What is AeroFS. Installing AeroFS. Learn How to Install AeroFS and get started syncing and sharing securely INTRODUCTION

Zoho CRM and Google Apps Synchronization

Learning Management System (LMS) Quick Tips. Contents LMS REFERENCE GUIDE

Advanced BIAR Participant Guide

ORACLE BUSINESS INTELLIGENCE WORKSHOP

CHAPTER 11 Broadcast Hub

Joomla! 2.5.x Training Manual

NAS 206 Using NAS with Windows Active Directory

TraceNet Command TM Application Suite User Guide

Transitioning from TurningPoint 5 to TurningPoint Cloud - LMS 1

How to create buttons and navigation bars

Outlook Express POP Instructions - Bloomsburg University Students

Exercise 10: Basic LabVIEW Programming

Altima Lookbook Free Extension v

Bookstore Application: Client Tier

CONTENTM WEBSITE MANAGEMENT SYSTEM. Getting Started Guide

Outlook Profile Setup Guide Exchange 2010 Quick Start and Detailed Instructions

How to install and use the File Sharing Outlook Plugin

MY EWU PORTAL FEATURES AND BENEFITS. Promotion of the Eastern brand name

Blackboard Integration - Instructor Guide

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Qvidian Playbooks & Salesforce Setup Guide. Fall Release 2013

Oracle Business Intelligence Publisher: Create Reports and Data Models. Part 1 - Layout Editor

Perform this procedure when you need to add a recurring payment option, or when you need to change or withdraw it.

Chapter 4: Website Basics

Scientific m-learning. 4-7 June Mobile Application Development using App Inventor for Android Devices

Dreamweaver Tutorials Creating a Web Contact Form

Google Docs A Tutorial

Backups User Guide. for Webroot SecureAnywhere Essentials Webroot SecureAnywhere Complete

BID2WIN Workshop. Advanced Report Writing

Rev. 06 JAN Document Control User Guide: Using Outlook within Skandocs

Transcription:

App Inventor Tutorial 10 Calculator This tutorial will help you develop a calculator using If statements and a ListPicker. You will be asked to enter 2 numbers, Number1 and Number2. When you have entered your numbers, select the function from the ListPicker and click on the Calculate button. The answer to the sum will be calculated and displayed by the app. The ListPicker will allow you to select from one of the following functions: +, -, x, /. Step 1: Open App Inventor To work online: Go to http://beta.appinventor.mit.edu Use your google account details to log in. Or working offline with the local server: Once you have the App Inventor running type into your browser http://localhost:8888 When you are taken to the app inventor page create a new project. This window will appear. Give the project the name Calculator and click OK. The project is now added and you will be taken to the designer screen. 1

Step 2: Build the Interface of Calculator From the Palette Panel drag a Label over and place on your screen. Rename it Title_Label. Set the FontSize to 18.0 Set the Text Property to My Calc. 2

Go to the Palette Panel. Click on Screen arrangement and drag a HorizontalArrangement onto your screen below the Title_Label My Calc. Drag a textbox into the HorizontalArrangement. Remove the text from Hint Select the Numbers Only checkbox. Set its width to 50 pixels. 3

From the Palette Panel, under the Basic category drag a ListPicker over to the HorizontalArrangement, to the right of the TextBox1. Set the Text Property for the ListPicker to +. Drag another TextBox into the HorizontalArrangement. Place this to the right of the ListPicker. Remove the text from Hint Select the Numbers Only checkbox Set the width to 50 pixels 4

Drag a label into the HorizontalArrangement to the right of TextBox2. Rename the label Equals_Label. Set the Text Property to =. Drag another label over to the right of the Equals_Label. Set the Text Property to Result and rename the component Result_Label. 5

From the Palette Panel drag a button over to the screen and place it below the HorizontalArrangement. Rename the button Calculate_Button and set the Text Property to Calculate. The ListPicker creates a list of items. The user can select from the options in this list. We need to add the +, -, x, / to our list. Under the Components Panel select ListPicker1. In the Properties Panel, under ElementsFromString add +, -, x, / (+ comma space - comma space x comma space /). Add + to the Selection Property. 6

Step 3: Add the functionality to the Interface Once the interface is ready we can set the functionality of the components. What we want to happen can be described in the following steps: 1. The user enters 2 numbers in the text boxes 2. The user selects a function (+,-,x,/) 3. The user clicks on the calculate button and the result is displayed. The functionality of the program (step 3) is added by using the Blocks Editor - Along the top of your App Inventor panel you will notice a button which says 'Open the Blocks Editor'. Click on this button ListPicker Functionality We need the text that is displayed on the ListPicker1 to change when the user selects a new choice. From the My Blocks tab click on ListPicker1. Select the (when ListPicker1.AfterPicking do) piece and drag it onto the board. From the My Blocks tab click on ListPicker, Select the (set ListPicker1.Text to) piece and connect this to the (when ListPicker1.AfterPicking do) piece. From the My Block tab click on ListPicker. Select the ListPicker1.Selection piece and connect this to the (set ListPicker1.Text to) piece. The ListPicker block is shown below. 7

If-Then Statements Remember that the value of the ListPicker is the value that the user has selected. We want the app to add the numbers together when the user selects the +, to subtract the numbers when the use selects -,to multiply the numbers when the user selects the x and to divide the numbers when the user selects the /. To do this we need to use an If block. From the My Blocks tab, click on Calculate_Button. Drag the (when Calculate_Button.Click do) piece onto the board. Go to the Built-In tab, click Control and drag the If block onto the board. Insert the If block into the (when Calculate_Button.Click do) piece. Under the My Blocks tab, click on Result_Label. Drag the (set Result_Label.Text to) piece onto the board. Connect the (set Result_Label.Text to) piece to the then-do part of the If block. From the Built-In tab, click on Math and drag the + piece onto the board. Add this piece to the (set Result_Label.Text to) piece. 8

From the My Blocks tab, click on TextBox1 and drag over the TextBox1.Text piece. From the My Blocks tab, click on TextBox2 and drag over the TextBox2.Text piece. Add the TextBox1.Text piece to the first gap in the + piece. Add the TextBox1.Tex2 piece to the 2 nd gap in the + piece. We need to fill in the test part of the If block. From the Built-In tab, click on Math and drag a = piece over to the board. Connect the = piece to the test part of the If block. From the My Blocks tab, click on ListPicker and drag the ListPicker1.Selection piece to the board. Add this piece to the 1 st empty space in the = block. 9

From the Built-In tab, click on Text and drag a text piece over to the board. Change the text on this piece to +. Add this piece to the 2 nd empty space in the equals block. The complete block for the add function is shown below. When the Calculate_Button is pressed and the ListPicker is set to +, the app will add the 2 numbers together. We need to repeat this process for the subtract, multiply and divide functions. Rebuild the If block but change the text piece to -, x and /. Also, remember to change the math pieces. The finished block is shown below. 10

Test your app by connecting to the emulator or your device. You should be able to add, subtract, multiply and divide your numbers. 11