4.5. Respond to the touch interface 4.6. Code additional HTML5 APIs 4.7. Access device and operating system resources JavaScript Coding for the Touch Interface,

Slides:



Advertisements
Similar presentations
Events Part III The event object. Learning Objectives By the end of this lecture, you should be able to: – Learn to use the hover() function – Work with.
Advertisements

Chapter 6 © 2012 by Addison Wesley Longman, Inc Introduction Def: A dynamic HTML document is one whose tag attributes, tag contents, or element.
Understanding Mobile App Development Concepts and Working with APIs Lesson 6.
Event Handling. Overview How to listen (and not listen) for events Creating a utility library (and why you should) Typology of events Pairing event listeners.
This document guides you through using the common features of the InFocus™ Mondopad™ touchscreen display located in this room. Getting Started Power Display.
Cos 381 Day 7. © 2006 Pearson Addison-Wesley. All rights reserved. 6-2 Agenda Assignment 2 Posted –Program a web-based Version of Soduku using JavaScript.
CHAPTER 26 CREATING LOCATION-AWARE WEBPAGES USING GEOLOCATION.
Done by: Majd Sbiei. Grade: 7E. Submitted to: Mr. Yousef.
Semantic Scrolling How to navigate structured documents.
Canvas, SVG, Workers Doncho Minkov Telerik Corporation
Spring /6.831 User Interface Design and Implementation1 Lecture 26: Mobile User Interfaces.
Chapter 25 Utilizing Web Storage.
JavaScript Events and Event Handlers 1 An event is an action that occurs within a Web browser or Web document. An event handler is a statement that tells.
Execution Environment for JavaScript " Java Script Window object represents the window in which the browser displays documents. " The Window object provides.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
HTML5. HTML5’s overall theme The browser as a rich application platform rich, cross-device user interfaces offline operation capability hardware access.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
© 2012, Mike Murach & Associates, Inc.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
DOM Events. JS Events Outline About Events – Introduction – Registering events – Getting information from events Event order/phases – Preventing default.
Chapter 5: Windows and Frames
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
Exploring Windows and Essential Computing Concepts 1 Windows Desktop u Windows Basics u Icon u Start Button u My Computer u Network Neighborhood u Recycle.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Where Value and Innovation Co-exist Gestures and User Interaction Best Practices.
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 12.
DOM Events. JS Events Outline About Events – Introduction – Registering events – Getting information from events Event order/phases – Preventing default.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Managing the Application Life Cycle
7. JavaScript Events. 2 Motto: Do you think I can listen all day to such stuff? –Lewis Carroll.
Chapter 6 © 2014 by Pearson Education Introduction Def: A dynamic HTML document is one whose tag attributes, tag contents, or element style properties.
Understanding JavaScript and Coding Essentials Lesson 8.
Rich Internet Applications 9. HTML 5 and RIAs. HTML 5 Standard currently under development by W3C Aims to improve the language with support for the latest.
MTA EXAM HTML5 Application Development Fundamentals.
Events Event Handling in JavaScript SoftUni Team Technical Trainers Software University
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
(1) HTML5, CSS, Twitter Bootstrap. (2) HTML5 Will be the new standard New features Drag and Drop and Support for local storage,,,, New input types Removed.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Chapter 6 Dynamic Documents with JavaScript. © 2006 Pearson Addison-Wesley. All rights reserved Introduction Def: A dynamic HTML document is.
JavaScript, Sixth Edition
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
CSE 154 LECTURE 10: MORE EVENTS. Problems with reading/changing styles Click Me HTML window.onload = function() { document.getElementById("clickme").onclick.
04 | Code by Using JavaScript Christopher Harrison | Content Developer, Microsoft Rachel Jones| Microsoft Certified Trainer, SourceDev.
Agenda Steps of App Building The Runtime Environment Managing App Data Debug and Test an App Validate an App Publish an App to a Store Packaging Apps.
Office 2013 and Windows 8: Essential Concepts and Skills Microsoft Office 2013.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
Chapter 6 © 2003 by Addison-Wesley, Inc Introduction - Dynamic HTML is not a new markup language - A dynamic HTML document is one whose tag attributes,
CHAPTER 7 TouchGestures. Chapter objectives: To code the detection of and response to touch gestures. Patterns of common touches to create touch gestures.
Microsoft Excel Illustrated Introductory Workbooks and Preparing them for the Web Managing.
6.1 Introduction 6.2 Element Positioning
Programming Web Pages with JavaScript
Inserting and Working with Images
CHAPTER 9 APIS. CHAPTER 9 APIS WHAT IS AN API?
Microsoft Office 2007 MS-Word.
Objectives To define terminology associated with Windows operating systems. To examine uses of Windows in business and industry. To explain techniques.
Objectives To review concepts covered in the Windows Operating Systems units.
Lesson 1: Buttons and Events – 12/18
JavaScript and Events.
The Application Lifecycle
CSE 154 Lecture 11: More Events.
Events.
Customizing Maps Custom controls to change the content of the map
JavaScript and Events CS Programming Languages for Web Applications
JavaScript Event Handling For Interaction and Casual Games
6.1 Introduction 6.2 Positioning Elements
Presentation transcript:

4.5. Respond to the touch interface 4.6. Code additional HTML5 APIs 4.7. Access device and operating system resources JavaScript Coding for the Touch Interface, Device and Operating System Resources, and More

Agenda Touch Interfaces HTML5 APIs Web Storage API

Touch Interfaces

Developing for Touch Interfaces

Common Touch Gestures GESTUREMOUSE EQUIVALENTDESCRIPTION TapLeft-clickTap a finger on the screen Double tapLeft double-clickTapping a finger on the screen twice Press and holdRight-clickPress and hold a finger on the screen, then release Selection/dragMouse drag (selection)Drag a finger to the left or right ZoomCTRL + mouse wheel forward or backwards Pinch an object inwards or outwards

Common Touch Gestures TAPDOUBLE TAP PRESS AND HOLD DRAG ZOOM Illustrations provided by GestureWorks® (

Event Listeners To make an application respond, we use the addEventListener method to attach an event handler to an HTML element The general syntax for addEventListener is as follows: document.addEventListener("touchstart", touchStartHandler, false);

Gesture Events A gesture event occurs when a user touches the screen with multiple fingers Common gesture events are: GESTURE EVENTDESCRIPTION gesturestart Every new two-finger gesture triggers a gesturestart event gesturechange When both of those fingers move around the screen, it triggers a gesturechange event gestureend Lifting both fingers from the screen triggers a gesturechange event

Touch Events A touch event is an action that an application takes in response to a gesture Common touch events are: TOUCH EVENTDESCRIPTION touchstart A new finger touch triggers a touchstart event touchmove A touchmove event tracks fingers movements as they occur on screen touchend Lifting a finger from the screen triggers a touchend event touchcancel A touchcancel event occurs when a new application is launched

Touch Objects PROPERTYDESCRIPTION identifier an id for the touch object target the HTML element affected clientx horizontal positioning relative to the browser clienty vertical positioning relative to the browser pagex horizontal positioning relative to the HTML document pagey vertical positioning relative to the HTML document screenx horizontal positioning relative to the screen screeny vertical positioning relative to the screen

Different Touchlists Each touch event features three different touchlists, as featured in the table below PROPERTYDESCRIPTION touches A list of all touch points currently in contact with the screen targetTouches A list of touch points currently in contact with the screen and whose touchstart event occurred within the same node (inside the same target element as the current target element changedTouches A list of touch points that caused the current event to be fired; for example, in a touchend event, this is the finger that was removed

Detecting a Touch Screen Demo

Web Hypertext Application Technology Working Group

Geolocation API navigator.geolocation.getCurrentPosition(showmap); function showmap(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; // Insert code to display a map }

Web Workers

WebSocket API

File API

Web Storage API

localStorage and sessionStorage

Implementing Web Storage, pt. 1 Use the localStorage and sessionStorage objects with the methods in the table to manage key/value pairs METHODSFUNCTION setItem(key, value) Creates a new key/value pair getItem(key) Gets the value for the specified key removeItem() Removes the specified key/value pair clear(); Clears all information from the storage object

Implementing Web Storage, pt. 2 Add a key/value pair to a sessionStorage object by using the following format: Add a key/value pair to a localStorage object by using the following format: sessionStorage.setItem('key', 'value'); var myVar = sessionStorage.getItem('key'); localStorage.setItem('key', 'value'); var myVar = localStorage.getItem('key');

Accessing Hardware

Summary Touch Interfaces HTML5 APIs Web Storage API

© 2015 Microsoft Corporation. All rights reserved.