It’s true: if you know HTML, CSS, and JavaScript, you already have the tools you need to develop Android applications. Now updated for HTML5, the second edition of this hands-on guide shows you how to use open source web standards to design and build apps that can be adapted for any Android device. You’ll learn how to create an Android-friendly web app on the platform of your choice, and then use Adobe’s free PhoneGap framework to convert it to a native Android app. Discover why device-agnostic mobile apps are the wave of the future, and start building apps that offer greater flexibility and a much broader reach.Convert a website into a web application, complete with progress indicators and other features Add animation with JQTouch to make your web app look and feel like a native Android app Make use of client-side data storage with apps that run when the Android device is offline Use PhoneGap to hook into advanced Android features, including the accelerometer, geolocation, and alerts Test and debug your app on the Web with real users, and submit the finished product to the Android Market
Author(s): Jonathan Stark, Brian Jepson
Edition: 2
Publisher: O'Reilly Media
Year: 2012
Language: English
Pages: 176
Table of Contents......Page 7
Preface......Page 11
Conventions Used in This Book......Page 12
Safari® Books Online......Page 13
Acknowledgments......Page 14
What Is a Native App?......Page 17
Which Approach Is Right for You?......Page 18
Introduction to HTML......Page 19
Introduction to CSS......Page 22
Applying a stylesheet......Page 24
Introduction to JavaScript......Page 25
Don’t Have a Website?......Page 29
First Steps......Page 31
Prepare a Separate Android Stylesheet......Page 35
Control the Page Scaling......Page 36
Adding the Android CSS......Page 38
Adding the Android Look and Feel......Page 42
Adding Basic Behavior with jQuery......Page 44
What You’ve Learned......Page 49
Adding a Touch of Ajax......Page 51
Traffic Cop......Page 52
Setting Up Some Content to Work With......Page 54
Routing Requests with JavaScript......Page 55
Progress Indicator......Page 57
Setting the Page Title......Page 60
Handling Long Titles......Page 62
Automatic Scroll-to-Top......Page 63
Roll Your Own Back Button......Page 65
Adding an Icon to the Home Screen......Page 72
What You’ve Learned......Page 73
Sliding Home......Page 75
Adding the Dates Panel......Page 78
Adding the Date Panel......Page 81
Adding the New Entry Panel......Page 84
Adding the Settings Panel......Page 86
Putting It All Together......Page 90
Customizing jQTouch......Page 92
What You’ve Learned......Page 94
Web Storage......Page 95
Saving User Settings to Local Storage......Page 96
Saving the Selected Date to Session Storage......Page 100
Web SQL Database......Page 101
Creating a Database......Page 102
Inserting Rows......Page 106
Error handling......Page 107
Selecting Rows and Handling Result Sets......Page 109
Deleting Rows......Page 113
Web Database Error Code Reference......Page 117
What You’ve Learned......Page 118
The Basics of the Offline Application Cache......Page 119
Online Whitelist and Fallback Options......Page 123
Creating a Dynamic Manifest File......Page 129
Debugging......Page 133
The JavaScript Console......Page 134
What You’ve Learned......Page 136
Introduction to PhoneGap......Page 137
Download and Install Eclipse Classic......Page 138
Install the ADT Plug-In in Eclipse......Page 139
Add Android Platforms and Other Components......Page 140
Set Up a New Android Project......Page 141
Running Kilo as an Android App......Page 143
Beep, Vibrate, and Alert......Page 145
Geolocation......Page 149
Accelerometer......Page 156
What You’ve Learned......Page 159
Removing Debug Code......Page 161
Versioning Your App......Page 162
Uploading Your App to the Android Market......Page 163
Distributing Your App Directly......Page 165
Further Reading......Page 169
Installation......Page 171
Configuration......Page 172
Testing wurfl-php......Page 173