Sunday – 1 August 2010.  How to create new mobile device application project  How to compile and package mobile device project, and make it installable.

Slides:



Advertisements
Similar presentations
Chapter 8 Improving the User Interface
Advertisements

CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 63 – Manipulating Data Using Methods – Day 2.
Chapter 3: Engage! Android User Input, Variables, and Operations
Java Programming, 3e Concepts and Techniques Chapter 4 Decision Making and Repetition with Reusable Objects.
Exceptions CIS 304 Intermediate Java Programming for Business.
Java Programming, 3e Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
1 Lab Session-3 CSIT221 Spring 2003 b Group Worksheet 3 Exercise (Demo Required) b No new lab demo will be assigned to allow you to focus on HW#1.
JavaScript Lesson 1 TBE 540. Prerequisites  Before beginning this lesson, the learner must be able to… Create a basic web page using a text editor and/or.
Chapter 7 Improving the User Interface
Chapter 7. 2 Objectives You should be able to describe: The string Class Character Manipulation Methods Exception Handling Input Data Validation Namespaces.
Chapter 3b Standard Input and Output Sample Development.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 7 – Class Average Application: Introducing.
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
Java Programming, 2E Introductory Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
An Introduction to Textual Programming
Java Programming, 3e Concepts and Techniques Chapter 3 Section 62 – Manipulating Data Using Methods – Day 1.
SOFTWARE TECHNOLOGY - I CONSTANTS VARIABLES DATA TYPES.
General Programming Introduction to Computing Science and Programming I.
Section 2 Variables National 4/5 Scratch Course. What you should know after this lesson What a variable is Where variables are stored How to get data.
© 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Programming with Java Chapter 4 Performing Calculations and Formatting.
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley
1 Object-Oriented Software Engineering CS GUI building with NetBeans Contents User Interaction JButtons JTextFields JLabels JForms in NetBeans Practical.
Computer Programming 2 Lab(1) I.Fatimah Alzahrani.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
Type Conversions Implicit Conversion Explicit Conversion.
CSci 111 – computer Science I Fall 2014 Cynthia Zickos WRITING A SIMPLE PROGRAM IN JAVA.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
CMP-MX21: Lecture 4 Selections Steve Hordley. Overview 1. The if-else selection in JAVA 2. More useful JAVA operators 4. Other selection constructs in.
GUI Applications ButtonGroup and JRadioButton. Contents A.Problem: The Metric Converter Application B.Solution C.Exercise: Moving all calculations into.
Lesson 4 Input. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are using. The reason it is not.
Java Programming, 2E Introductory Concepts and Techniques Chapter 4 Decision Making and Repetition with Reusable Objects.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Exceptions, handling exceptions & message boxes Year 11 Information Technology.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
1 Chapter 3 – Examples The examples from chapter 3, combining the data types, variables, expressions, assignments, functions and methods with Windows controls.
1 Class 6. 2 Objectives Objectives Identify, declare, and use primitive data types Use the System class to create data streams Use the Scanner class of.
NetTech Solutions Troubleshooting Office Applications Lesson Seven.
C++ for Engineers and Scientists Second Edition Chapter 7 Completing the Basics.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Data Types and Conversions, Input from the Keyboard CS303E: Elements of Computers and Programming.
More Sequences. Review: String Sequences  Strings are sequences of characters so we can: Use an index to refer to an individual character: Use slices.
110 E-1 Variables, Constants and Calculations(2) Chapter 3: Operations on variables, scope of a variable, formatting data Doing Arithmetic.
Martin T. Press.  Main Method and Class Name  Printing To Screen  Scanner.
CS1101: Programming Methodology
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
InterestRate Create an InterestRate class and InterestRateViewer client class to do the following: A person is purchasing an item with their credit card.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
Primitive Data Types int is a primitive data type A primitive data type is one that stores only a single piece of data. TypeStorageDescription int 4 bytes+ve.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
JAVA 1.COMPARISON: JAVA AND C++ 2.KEYBOARD INPUT 3.OUTPUT 4.CONVERSION FROM STRING 5.OPERATORS AND EXPRESSIONS 6.DIALOG BOX – USER PROMPT January
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
A variable is a name for a value stored in memory.
2.5 Another Java Application: Adding Integers
Explain what touch develop is to your students:
INPUT STATEMENTS GC 201.
Chapter 5 Processing Input with Applets
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Data Types and Maths Programming Guides.
Python Creating a calculator.
Presentation transcript:

Sunday – 1 August 2010

 How to create new mobile device application project  How to compile and package mobile device project, and make it installable on mobile phone  How to create basic navigation flow  How to display data/information on StringItem, Ticker  How to get data input from user using TextField

By the end of this Lab session, you should be able to: Get numerical data from TextField Perform basic calculation (unit conversion) using Java method Perform Error Handling, Display AlertBox Use POPUP ChoiceGroup Create a robust TextField that will only accept numerical value

 Your task is to develop Unit Conversion mobile application  Convert from Meter metric unit to Feet Formula ? Feet = meter * 3.281

 Create 1 TextField, rename to “Value”  Create one StringItem, rename to Result  Add one ScreenCommand to perform conversion Other consideration…  Create a new java method for conversion meterToFeet(double value){}

 Warning: you might want to create Double or Float variable and use Double.parseDouble or Float.parseFloat to change String variable to numerical value  You can change numerical value back to String by using Double.valueOf(string) or Float.valueOf(string)

textField.getString() Get Value from TextField Create java method to perform calculation Still remember how to create method? meterToFeet(double value) Perform calculation stringItem.setText(value) Set the converted value to StringItem

 What do you remember from yesterday’s lesson?  What are the problem that you encounter with this solution?  How to improve it?

 TextField have “Input Constraints” properties that can change its behavior to user input  Try to change it to “Numeric” or “Decimal”. What did you see?

 Sometimes it is nice to be able to prompt user to input the correct data  In this case, we use Alert  Use “Alert” to notify user that they need to input value greater than 0

If (value <=0.0) { Alert alert = new Alert("Please enter positive value"); switchDisplayable(alert,getForm()); }

 Did you notice the Exception text when you leave the TextField blank?  As an exercise, try to handle that exception, using common java knowledge, and remind user that they have to enter value to get conversion result.

 How about giving option to user to convert from other units too?  So we should use ChoiceGroup