Thông tin tài liệu:
You have a great idea for a simple mobile web app. Or, you have a great idea for a complicated mobile web app. Either way, Learn HTML5 and JavaScript for iOS will help you build, fine-tune, and publish your app for iPhone, iPad, or iPod touch. Scott Preston will walk you through building a mobile web app from scratch using real-world examples. Youll learn about design considerations, mobile web frameworks, and HTML5 features like animation and graphics using Canvas.
Nội dung trích xuất từ tài liệu:
Learn HTML5 and JavaScript for iOSwww.it-ebooks.infoFor your convenience Apress has placed some of the frontmatter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. www.it-ebooks.infoContents at a Glance Contents..................................................................................................................vii About the Author ................................................................................................. xxix About the Technical Reviewer ............................................................................. xxix Preface ................................................................................................................. xxx ■ Chapter 1: Getting Started ...................................................................................1 ■ Chapter 2: HTML5 in Short .................................................................................21 ■ Chapter 3: CSS3 and iOS Styling ........................................................................41 ■ Chapter 4: JavaScript and APIs .........................................................................65 ■ Chapter 5: Mobile Frameworks..........................................................................85 ■ Chapter 6: Usability, Navigation, and Touch ....................................................103 ■ Chapter 7: GPS and Google Maps.....................................................................121 ■ Chapter 8: Animation and Effects ....................................................................141 ■ Chapter 9: Canvas ............................................................................................157 ■ Chapter 10: Audio and Video............................................................................175 ■ Chapter 11: Integrating with Native Services ..................................................185 ■ Chapter 12: Offline Apps and Storage..............................................................195 ■ Chapter 13: Mobile Testing ..............................................................................203 ■ Chapter 14: Advanced Topics ..........................................................................219 ■ Chapter 15: Going Native with PhoneGap ........................................................229 v www.it-ebooks.info ■ Appendix: Companion Site References ............................................................249 Index.....................................................................................................................263vi www.it-ebooks.infoCHAPTER 1■■■Getting StartedCongratulations! You are building your first web application for your iOS device (iPhone, iPad, or iPodTouch) using HTML5 and JavaScript. You might think that you can pick up one of your HTML or JavaScript books from years past andthen just scale it down to the size of your target device and you’ll be good to go. You’d be wrong. A lothas changed. In this chapter we lay the groundwork for building a mobile web app. Here we cover things likegetting familiar with your browser, setting up your mobile project, architecting the site, and creating asite map as well as selecting the tools you’ll use to build it. All you need is an idea, and I’ll help you take care of the rest. You purchased this book to get started building a mobile web app. I won’t beat around the bush andtell you about the history of the Internet or the history of browsers. Instead, let’s just jump in.Your Browser (Mobile Safari)The browser we’ll focus on is Mobile Safari—a WebKit-based browser engine that does an excellent jobof parsing HTML5 and interpreting JavaScript.■ Note Browsers use different rendering engines. Safari and Google Chrome use WebKit, Opera uses Presto,Firefox uses Gecko, and Internet Explorer uses Trident. In later chapters we’ll need to use specific features ofWebKit to achieve a more native-looking mobile web application. Mobile Safari acts and renders in many ways similar to regular Safari, but it has a smaller screen, ofcourse, and responds to gestures and touches as opposed to clicks. It also has noticeable performancedifferences and does not support Adobe Flash. One of mobile Safari’s most important screens is its Settings screen. You can get to it by clicking onSettings, and then Safari on the iPhone or iPad home screen. You’ll see a screen like the one shown inFigure 1-1. 1 ...