Build Mobile Websites and Apps for Smart Devices is a practical guide for front-end web designers and developers. You’ll discover a fun and fresh approach to mobile web design and development, with enormous scope for opportunity. Mobile web development is changing rapidly, with a greater emphasis on modern touch-screen smartphones. By following the advice in this book, you can be sure you’re learning the skills you need to make the most of this new technology. You’ll learn how to:Design effective interfaces for modern devices Use HTML5 and CSS3 to build fast, responsive layouts that look great on every device Use JavaScript to create a native feel with transitions, touch and swipe events, animations, and more Introduces PhoneGap and shows readers how to add native functionally to their web app with ease Leverage APIs to take advantage of built-in device functionality Use PhoneGap to turn your web app into a native app for iOS, Android, BlackBerry, and other platforms—and sell it online And lots more...
Author(s): Earle Castledine, Max Wheeler, Myles Eftos
Edition: 1
Publisher: SitePoint
Year: 2011
Language: English
Pages: 280
Build Mobile Websites and Apps for Smart Devices......Page 3
Table of Contents......Page 9
Who Should Read This Book......Page 17
What’s in This Book......Page 18
The Book’s Website......Page 19
Your Feedback......Page 20
Max Wheeler......Page 21
Code Samples......Page 22
Tips, Notes, and Warnings......Page 23
What does it mean?......Page 25
The Natives Are Restless......Page 26
The Problem with Going Native......Page 27
Start at the Beginning......Page 29
Option One: Nada......Page 30
Option Two: Transform and Move Out......Page 31
Option Three: Forever Alone......Page 33
A Note on Frameworks......Page 34
Rolling Up Our Sleeves......Page 35
Design for Mobile......Page 37
Ready to Shine......Page 0
Markup for Mobile......Page 75
Style over Substance......Page 76
The Tab Bar......Page 78
Rows, Rows, Rows......Page 82
Images and Pseudo-elements......Page 88
Understanding the Viewport......Page 92
Know Your (Resource) Limits......Page 95
Modernizr to the Rescue......Page 97
Weighing In......Page 99
Building on Our Base......Page 100
Scalable Images......Page 106
Dealing with the Media......Page 108
Standalone Mode......Page 110
Tell Your Users......Page 112
Application Icons......Page 114
Text Overflow with Ellipsis......Page 118
Text Size Adjust......Page 120
User Select......Page 121
Moving On......Page 122
Frameworks and Libraries......Page 123
Debugging Mobile JavaScript......Page 124
Events......Page 126
Simple Touch Events......Page 128
Clicking with Feature Detection......Page 129
Quick Wins......Page 130
Email......Page 131
Maps......Page 132
Form Field Attributes......Page 133
Swapping Pages......Page 135
Fading with WebKit Animations......Page 138
Sliding......Page 143
Going Backwards......Page 145
Managing History......Page 147
Back with Hardware Buttons......Page 151
Fetching HTML......Page 155
Ajaxifying Links......Page 157
Templating......Page 159
Twitter Integration with Templating......Page 162
We Have an App!......Page 164
Using Device Features from Web Apps......Page 165
Fetching Location......Page 166
Handling Errors......Page 173
Device Rotation......Page 174
Accelerometers: Device Orientation......Page 176
Accelerometers......Page 177
Shake Gesture......Page 178
Touch Gestures......Page 180
Swiping Photo Gallery......Page 181
Pinch and Zoom......Page 185
Going Offline......Page 187
The Cache Manifest......Page 188
Cache Manifest Events......Page 191
Network and Fallback......Page 193
An Eventful Chapter......Page 194
Web App Tricks......Page 195
Fixed Menus......Page 196
Clicking Faster......Page 199
Loading Your Libraries......Page 200
Feature Detection......Page 201
Widgets......Page 202
Dialog Boxes......Page 203
Spinners......Page 206
Storing Data on the Client......Page 207
Local Storage......Page 208
Web SQL Database......Page 211
Modules......Page 214
Custom Events......Page 217
Other Frameworks......Page 219
Conclusion......Page 220
Introducing PhoneGap......Page 221
Embedding Web Pages in Native Apps......Page 222
PhoneGap......Page 223
Debugging Is Painful......Page 224
Alternatives......Page 225
Installing the SDKs......Page 226
MacPorts (OS X)......Page 227
OS X......Page 228
Windows......Page 229
Apple iOS SDK......Page 230
Using the SDK Manager......Page 231
Creating an Android Virtual Device......Page 232
WebOS SDK......Page 234
Xcode......Page 235
Android......Page 236
WebOS......Page 239
Review......Page 240
The Anatomy of a PhoneGap Application......Page 241
iOS......Page 243
BlackBerry......Page 247
WebOS......Page 248
Are we ready?......Page 249
Network Checks......Page 250
Back......Page 252
Menu......Page 253
Paparazzi—Accessing the Camera......Page 254
iOS......Page 257
Android......Page 258
BlackBerry......Page 259
The Apple App Store......Page 260
The Android Market......Page 262
BlackBerry App World......Page 263
Palm App Catalog......Page 264
Time for Celebration......Page 266
Using Python......Page 267
Built-in Servers: Apache on Linux......Page 268
Index......Page 271