1 / 42

SD1230

SD1230. Unit 10 Mobile Web. Course Objectives. During this unit, we will cover the following course objectives: Identify the characteristics of website applications . Describe the differences and similarities of mobile Web and mobile applications.

ronni
Download Presentation

SD1230

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SD1230 Unit 10 Mobile Web

  2. Course Objectives • During this unit, we will cover the following course objectives: • Identify the characteristics of website applications. • Describe the differences and similarities of mobile Web and mobile applications. • Describe the process used to build a mobile website.

  3. Learning Outcomes • Completing this unit should help enable you to: • Identify the characteristics of mobile Web apps and mobile websites. • Create a simple mobile website. • Understand the behaviors and habits of mobile users. • Explore the design differences between mobile websites and desktop websites.

  4. Learning Outcomes (cont.) • Create a simple mobile website with a template. • Add a location of Google Maps to a mobile website. • Add a photo gallery to a mobile website. • Add a search engine link to a mobile website.

  5. Why Prioritize iPhone Web App Development? • The iPhone has proven to be the market leader in terms of innovation and market share of the devices that access the mobile Web the most. • The iPhone is marketed, sold, and supported by Apple, not the operator. • The iPhone has the lowest development cost for the highest number of supported devices. • It requires little to no additional knowledge apart from HTML, CSS, and JavaScript. • It has simple and cost-effective testing. • It is the highest consumer of mobile data.

  6. WebKit • Open source Web browser engine • Ideal for mobile devices • Small footprint • Capability of rendering full-scale desktop websites on mobile devices • Basis for iPhone and Android browsers

  7. Mobile Safari

  8. Android Browser

  9. Mobile Web App Characteristics • Is an application-like experience that alters existing views, in place, instead of loading new pages like a traditional website • Uses client-side (or offline) storage for local data • Heavily uses DHTML or Ajax to create the user experience • Has a defined viewport for the mobile context • Can run in full-screen mode • Can be launched like a native application

  10. Mobile Web Site vs. Mobile Web App Mobile website Mobile Web app Single-page model Uses Ajax to load content based on user actions Does not degrade to lower-end devices • Multi-page model • Hierarchical page structure • Degrades to lower-end devices

  11. XHTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <title>An XHTML 1.0 Compliant Document</title> </head> <body> <p>Here is some text</p> </body> </html>

  12. Script to Determine if the Client Is a WebKit Browser on a Mobile Device function iPhoneClient() { return RegExp(" AppleWebKit/").test(navigator.userAgent) && RegExp(" Mobile/").test(navigator.userAgent); }

  13. HTML5 • New elements • canvas • header • nav • article • section • aside • footer • Offline data storage

  14. Canvas Element <head> <script type="text/javascript" charset="utf-8"> function draw() { // grab the canvas element var canvas = document.getElementById("canvas"); if (canvas.getContext) { // grab the context var ctx = canvas.getContext("2d"); // background box ctx.fillStyle = "rgba(100, 100, 100,0.2)"; ctx.fillRect(0, 0, 90, 90); // first, smallest ctx.fillStyle = "rgba(100,100,100,0.5)"; ctx.fillRect(10, 10, 10, 10); } } </script>

  15. Canvas Element <body onload="draw();"> <canvas id="canvas" width="150" height="150"> <p>This example requires a browser that supports the <a href="http://www.w3.org/html/wg/html5/">HTML5</a> &lt;canvas&gt; feature.</p> </canvas> </body>

  16. Offline Data Storage

  17. CSS2 • Acid2 test • Mobile Safari does not have a perfect score. • Supports most positioning techniques

  18. CSS3 • Supports majority of CSS3 selectors • 97% on Acid3 test

  19. Multiple Background Images

  20. Box Sizing <div style="width: 200px; border: 5px black solid; padding: 10px; -webkit-box-sizing:border-box;"> Box </div>

  21. Other Box Effects • box-shadow -webkit-box-shadow: hoff voff blur color; • Rounded corners -webkit-border-radius: 5px; • Border images -webkit-border-image: url("border.png") 20 14 round stretch;

  22. Text Effects • Text shadow text-shadow: 3px 3px 2px #333333; -webkit-text-fill-color: #0000ff; -webkit-text-stroke: 1px #000; • Text overflow text-overflow: clip; text-overflow: ellipsis; .truncate { white-space: nowrap; (don't wrap the line) width: 200px; (define the visible area) overflow: hidden; (hide text outside the visible area) text-overflow: ellipsis; (add the ellipsis) }

  23. Visual Effects • Gradients • Masks • Transitions • Transforms • Animation • Hover, click, and tap

  24. Gradients -webkit-gradient(type, start_point, end_point, / stop...) -webkit-gradient(type, inner_center, inner_radius, outer_center, outer_radius, / stop...)

  25. Masks <img src="penny.png" style="-webkit-mask-box-image: url(heart.png);">

  26. Transitions -webkit-transition:property duration timing_function delay

  27. Transforms .rotate-me {-webkit-transform: rotate(45deg);

  28. Animations <style> top: .bounce { -webkit-animation-name: bounce; -webkit-animation-duration: 4s; -webkit-animation-iteration-count: 3; } </style>

  29. Animations <script type="text/javascript" charset="utf-8"> function restartBounce(element) { element.style.webkitAnimationName = ''; window.setTimeout(function() { element.style.webkitAnimationName = 'bounce'; }, 0); } </script> <body> <div class="bounce" onclick="restartBounce(this)"> </div> </body>

  30. Taps • Mobile phones don’t support hover because there is no mouse. • One way around it: • Hover action occurs on first tap. • Click action occurs on second tap. -webkit-tap-highlight-color: blue;

  31. JavaScript • Client-side script • Functions can be stored: • In external file • In the <head> section • Foundation for: • DHTML • Ajax

  32. DHTML <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script>

  33. Ajax • Developer causes event to happen on the server without a refresh in the browser • Three parts: • Data sent to server • Plain text • XML • JSON • Function to be performed on data • Request for response • Callback function

  34. Using CSS Transforms to Createa Fixed Footer

  35. Viewport • Area of the window where content can be seen by the user <meta name="viewport" content="width=device-width"> • Prevent the user from scaling <meta name="viewport" content="initial-scale=1.0, user-scalable=no">

  36. Full-Screen Mode • Browser back and forward buttons not available • Hyperlinks show the full browser window • Apple-only <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> • Changing the status bar appearance <meta name="apple-mobile-web-app-status-bar-style" content="black" />

  37. Tools and Libraries • PhoneGap • iPhone GUI PSD • iUI • JQTouch

  38. PhoneGap

  39. iPhone UI PSD

  40. iUI

  41. JQTouch

  42. Summary • In this unit, we covered the following topics: • WebKit browsers • Mobile website vs. mobile Web app • XHTML and HTML5 • CSS • JavaScript, DHTML, and Ajax • Tools and libraries

More Related