O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PhoneGap and AngularJS for Cross-platform Development

Book Description

Build exciting cross-platform applications using PhoneGap and AngularJS

In Detail

PhoneGap is a mobile development framework that allows developers to build cross-platform mobile applications. Building PhoneGap apps is traditionally done using HTML, CSS, jQuery Mobile, Eclipse Editor, and/or Xcode. The process can be cumbersome, from setting up your editor to optimizing your usage of jQuery, and so on. However, AngularJS, a new but highly popular JavaScript framework, eases these tasks with APIs to get access to mobile APIs such as notifications, geo-location, accelerometers, and more. Starting with the absolute basics of building an AngularJS application, this book will teach you how to quickly set up PhoneGap apps using the command-line interface.

You will learn how to create simple to advanced to-do lists and add authentication capabilities using PhoneGap's plugins. You will enhance your skills by writing a PhoneGap app using your newly learned AngularJS skills. Furthermore, you will learn about adding animation and interactive designs to your mobile web apps using PhoneGap plugins. By the end of the book, you will know everything you need to launch your app on both Android and iOS devices.

What You Will Learn

  • Learn about the features of AngularJS and use it to organize your code
  • Create RESTful web apps using AngularJS
  • Reduce the hassle of developing PhoneGap apps using the command-line interface
  • Quickly integrate AngularJS to enhance authentication capabilities via PhoneGap plugins
  • Use AngularJS touch modules to optimize your PhoneGap app
  • Build a cross-platform application with PhoneGap and AngularJS
  • Learn how to use the concepts of two-way data binding and directives along with PhoneGap for mobile application development

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. PhoneGap and AngularJS for Cross-platform Development
    1. Table of Contents
    2. PhoneGap and AngularJS for Cross-platform Development
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introduction to AngularJS
      1. A brief overview of AngularJS
        1. Core concepts
          1. Controllers
          2. Data-binding
          3. Directives
        2. A conceptual example
      2. A simple to-do list using AngularJS
        1. Preparing your code structure
        2. HTML for our to-do list
        3. Adding in JavaScript with AngularJS
      3. Summary
    9. 2. Getting Ready for PhoneGap
      1. Preparing for PhoneGap development
        1. Installing Android
        2. Installing iOS
      2. Command-line interface for both Android and iOS
          1. Running on real devices
      3. AngularJS on PhoneGap
        1. What just happened?
      4. Creating a to-do list app using AngularJS on PhoneGap
        1. A basic version of a to-do list using AngularJS on PhoneGap
      5. Summary
    10. 3. From a Simple To-do List to an Advanced To-do List
      1. Rewriting the simple to-do list app
        1. Splitting index.html into multiple files
        2. Splitting todo.js into multiple files
        3. Checkpoint
      2. Wiring up a backend server
        1. Coding our server
        2. Changing AngularJS to perform RESTful requests
        3. Using the $http module of AngularJS
        4. Rewriting controllers to make use of the $http module
        5. Checking our code
      3. Preparing for PhoneGap
      4. Testing our code on iOS
      5. Testing our code on Android
      6. Summary
    11. 4. Adding Authentication Capabilities Using PhoneGap Plugins
      1. Adding Facebook Connect to the to-do list app
        1. Initializing and preparing for Facebook Connect
        2. Writing the user controller
        3. Adding a login page
        4. Adding a logout function
        5. Checking the login status
      2. Facebook login for PhoneGap
        1. Installing the Facebook plugin
        2. Testing out Facebook Login on PhoneGap
      3. From web to PhoneGap
        1. Importing Facebook and PhoneGap plugins
        2. Changing FB to facebookConnectPlugin
      4. The to-do list app with Facebook Login on PhoneGap
      5. Summary
    12. 5. Sprucing Up the App Using Animations and Mobile Design
      1. Adding animations to your web app
      2. Adding mobile CSS styles to your app
      3. Porting your web app to PhoneGap
        1. Testing your app on iOS
        2. Testing your app on Android
      4. Summary
    13. 6. Getting Ready to Launch
      1. Deploying server.py
      2. Using phonegap.com
      3. Preparing your PhoneGap app for an Android release
        1. Testing your app on real devices
        2. Exporting your app to install on other devices
        3. Preparing promotional artwork for release
        4. Building your app for release
        5. Signing the app
      4. iOS
        1. Running your app on an iOS device
        2. Other techniques
          1. Using Xcode
      5. Summary
    14. A. References
      1. AngularJS and related libraries
      2. PhoneGap and related references
      3. Others
      4. Other tutorials
    15. Index