靜宜大學資管系 楊子青 1 Programming Your App’s Memory 靜宜大學資管系 楊子青 2013.3.4.

Slides:



Advertisements
Similar presentations
Understanding an Apps Architecture ASFA Computer Science: Principles Fall 2013.
Advertisements

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Unit 5 Spreadsheets 5.01 Introduction to Spreadsheets.
Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in.
Games in AppInventor ASFA Programming I November 14, 2012.
Model View Controller Development architecture. MVC Model: the classes encapsulating the functionality of your app View: what the user sees and interfaces.
App Inventor Barb Ericson July 3, 2013.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
No Texting While Driving. Introduction You'll design the app so that it sends a response to any text message received. You'll also allow the user to customize.
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.
Microsoft Access Database software. What is a database? … a database is an organized collection of data. A collection of data of similar information compiled.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
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.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
INTRODUCTION TO OPERATING SYSTEMS. An operating system is a program that controls the overall activity of a computer. Like an orchestra conductor an operating.
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.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
靜宜大學資管系 楊子青 1 Working with Databases (II) 靜宜大學資管系 楊子青
App Inventor MIT App Inventor.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Variables, operators, canvas, and multimedia Dr. José M. Reyes Álamo.
Quiz Me Tutorial. Introduction QuizMe is a trivia game (the example uses baseball) you can use as a template to build quizzes on any topic. The user steps.
1 Chapter 12: Form Builder Objects and Flexible Code.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 FUNCTIONS - I Chapter 5 Functions help us write more complex programs.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC PROGRAMMING FUNDAMENTALS Bilal Munir Mughal 1 Chapter-8.
Software Engineering Principles Dr. José M. Reyes Álamo.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
JavaScript, Fourth Edition
Balancing the scales: Inequalities By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Chapter 3 Control Structures. The If…Then Statement The If…Then statement is a Decision statement = that executes a set of statements when a condition.
Object Oriented Programming Criteria: P2 Date: 07/10/15 Name: Thomas Jazwinski.
Operating System Concepts Three User Interfaces Command-line Job-Control Language (JCL) Graphical User Interface (GUI)
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
MIT App Inventor Lesson 3 Algorithms Variables Procedures.
© 2010 Delmar, Cengage Learning Chapter 11 Creating and Using Templates.
Variables, operators, canvas, and multimedia Dr. Reyes.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Lesson 1 – Getting Started with App Inventor
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Input, Variables, and Calculations. The TextBox Component Performing Calculations Storing Data with Variables Creating Blocks with Typeblocking The Slider.
Introduction to Programming and App Inventor. Introduction What is a computer program? Introducing App Inventor Getting hands on with App Inventor.
Introduction to App Inventor 2 ASFA AP CS Principles
Chapter Topics 15.1 Graphical User Interfaces
Visual Programming week # 02 APP (Application) Architecture.
Engineering and Debugging an App Chapter 15
week # 03 Visual Programming Variables Canvas Screen Arrangement
Understanding an App’s Architecture
Chapter 16 – Programming your App’s Memory
Programming Your App to Make Decisions – Conditional Blocks
Completing the tasks for A452 with….
Understanding an App’s Architecture
Variables, operators, canvas, and multimedia
Working with Databases (I) 靜宜大學資管系 楊子青
CS285 Introduction - Visual Basic
Scratch 音樂 (靜宜資管楊子青)
ICT Gaming Lesson 3.
Chapter 15: GUI Applications & Event-Driven Programming
Programming Lists of Data 靜宜大學資管系 楊子青
CHAPTER FOUR VARIABLES AND CONSTANTS
Presentation transcript:

靜宜大學資管系 楊子青 1 Programming Your App’s Memory 靜宜大學資管系 楊子青

靜宜大學資管系 楊子青 2 Memory Slots Just as people need to remember things, so do apps. –When someone tells you the phone number of a pizza place for a onetime immediate call, your brain stores it in a memory slot. –In this chapter, you’ll learn how to set up an app’s memory, how to store information in it, and how to retrieve that information at a later time.

靜宜大學資管系 楊子青 3 Named Memory Slots An app’s memory consists of a set of named memory slots. –Some of these memory slots are created when you drag a component into your app; these slots are called properties. –You can also define named memory slots that are not associated with a particular component; these are called variables.

靜宜大學資管系 楊子青 4 1. Properties Components (Button, TextBox, and Canvas…) –are part of the user interface. Each component is completely defined by a set of properties. –The values stored in the memory slots of each property determine how the component appears.

靜宜大學資管系 楊子青 5 Modifying the memory slots in the property form to change the app’s appearance

靜宜大學資管系 楊子青 6 2. Variables Defining Variables Setting and getting a Variable Setting a Variable to an Expression –Incrementing a Variable –Building Complex Expressions Displaying Variables

靜宜大學資管系 楊子青 Defining Variables You define a variable when your app needs to remember something that is not being stored within a component property. –For example, a game app might need to remember what level the user has reached. If the level number is not something the user will see, you’d define a variable to store it.

靜宜大學資管系 楊子青 8 Defining Variables 1. Drag the def variable block from the Definitions folder in the Built-In blocks. 2. Change the name of the variable by clicking on the text “variable” and typing “score”.

靜宜大學資管系 楊子青 9 Defining Variables 3. Set the initial value to a number by dragging out the number block and plugging it into the variable definition. 4. Change the initial value from the default number (123) to 0.

靜宜大學資管系 楊子青 Setting and getting a Variable When you define a variable, App Inventor creates two blocks for it, both of which appear in the My Definitions drawer.

靜宜大學資管系 楊子青 11 (1) Set Global The set global to block lets you modify (set) the value stored in the variable. –For instance, the blocks place a 5 in the variable score. The term “global” in the set global score to block refers to the fact that the variable can be used in all of the program’s event handlers (globally). –Some programming languages allow you to define variables that are “local” to a particular part of the program; App Inventor does not.

靜宜大學資管系 楊子青 12 (2) Retrieve The block labeled global score helps you retrieve (get) the value of a variable. –For instance, if you wanted to check if the score was 100 or greater, you’d plug the global score block into an if test.

靜宜大學資管系 楊子青 Setting a Variable to an Expression Incrementing a Variable Building Complex Expressions

靜宜大學資管系 楊子青 14 The blocks contained in the Math drawer In the Math drawer of the Built-In blocks, App Inventor provides a wide range of mathematical functions similar to those you’d find in a spreadsheet or calculator.

靜宜大學資管系 楊子青 Displaying Variables Changing a variable has no direct effect on the app’s appearance. –When you modify a component property, the user interface is directly affected. This is not true for variables. –This is one of the advantages of storing data in a variable as opposed to a component property it allows you to show just the data you want when you want to show it. It also allows you to separate the computational part of your app from the user interface, making it easier to change that user interface later.