Cover image for Building Android Apps with HTML, CSS, and JavaScript, 2nd Edition

Book description

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.

Table of Contents

  1. Building Android Apps with HTML, CSS, and JavaScript
  2. Dedication
  3. Preface
    1. Who Should Read This Book
    2. What You Need to Use This Book
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
    7. Acknowledgments
  4. 1. Getting Started
    1. Web Apps Versus Native Apps
      1. What Is a Web App?
      2. What Is a Native App?
      3. Pros and Cons
      4. Which Approach Is Right for You?
    2. Web Programming Crash Course
      1. Introduction to HTML
      2. Introduction to CSS
        1. Applying a stylesheet
      3. Introduction to JavaScript
  5. 2. Basic Styling
    1. Don’t Have a Website?
    2. First Steps
      1. Prepare a Separate Android Stylesheet
      2. Control the Page Scaling
    3. Adding the Android CSS
    4. Adding the Android Look and Feel
    5. Adding Basic Behavior with jQuery
    6. What You’ve Learned
  6. 3. Advanced Styling
    1. Adding a Touch of Ajax
    2. Traffic Cop
      1. Setting Up Some Content to Work With
      2. Routing Requests with JavaScript
    3. Simple Bells and Whistles
      1. Progress Indicator
      2. Setting the Page Title
      3. Handling Long Titles
      4. Automatic Scroll-to-Top
      5. Hijacking Local Links Only
      6. Roll Your Own Back Button
    4. Adding an Icon to the Home Screen
    5. What You’ve Learned
  7. 4. Animation
    1. With a Little Help from Our Friend
    2. Sliding Home
    3. Adding the Dates Panel
    4. Adding the Date Panel
    5. Adding the New Entry Panel
    6. Adding the Settings Panel
    7. Putting It All Together
    8. Customizing jQTouch
    9. What You’ve Learned
  8. 5. Client-Side Data Storage
    1. Web Storage
      1. Saving User Settings to Local Storage
      2. Saving the Selected Date to Session Storage
    2. Web SQL Database
      1. Creating a Database
      2. Inserting Rows
        1. Error handling
      3. Selecting Rows and Handling Result Sets
      4. Deleting Rows
    3. Web Database Error Code Reference
    4. What You’ve Learned
  9. 6. Going Offline
    1. The Basics of the Offline Application Cache
    2. Online Whitelist and Fallback Options
    3. Creating a Dynamic Manifest File
    4. Debugging
      1. The JavaScript Console
    5. What You’ve Learned
  10. 7. Going Native
    1. Introduction to PhoneGap
    2. Building Your App Locally with Eclipse and the Android SDK
      1. Download and Install Eclipse Classic
      2. Download and Install the Android SDK
      3. Install the ADT Plug-In in Eclipse
      4. Add Android Platforms and Other Components
      5. Download the Latest Copy of PhoneGap
      6. Set Up a New Android Project
      7. Running Kilo as an Android App
    3. Controlling the Phone with JavaScript
      1. Beep, Vibrate, and Alert
      2. Geolocation
      3. Accelerometer
    4. What You’ve Learned
  11. 8. Submitting Your App to the Android Market
    1. Preparing a Release Version of Your App
      1. Removing Debug Code
      2. Versioning Your App
      3. Compile and Sign Your App
    2. Uploading Your App to the Android Market
    3. Distributing Your App Directly
    4. Further Reading
  12. A. Detecting Browsers with WURFL
    1. Installation
    2. Configuration
    3. Testing wurfl-php
  13. About the Authors
  14. Colophon
  15. Copyright