Book Image

PhoneGap and AngularJS for Cross-platform Development

By : Yuxian E Liang
Book Image

PhoneGap and AngularJS for Cross-platform Development

By: Yuxian E Liang

Overview of this book

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.
Table of Contents (14 chapters)
PhoneGap and AngularJS for Cross-platform Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Facebook login for PhoneGap


PhoneGap has gone through quite a bit of changes not only for the main library, but also the plugin system. In this section, you will see that we can quickly install PhoneGap plugins using the command-line tool, without the usual multiple steps that we have to follow if we want to install it manually.

Installing the Facebook plugin

Since we have already added iOS and Android platforms, this plugin installation will add plugins for both iOS and Android. To install the Facebook plugin, you will need to navigate to your todo app project. Next, issue the following command:

cordova plugin add
https://github.com/phonegap/phonegap-facebook-plugin, --variable APP_ID="XXXXX" --variable APP_NAME="AngularPhoneGapTest".

You will need to replace XXXX with your app ID and you can name your app_name app any name you want.

The installation process is now complete. For Android, you will need three more steps:

  1. Import your todo app into your Eclipse development environment as an Android...