Home Page Icon
Home Page
Table of Contents for
Chapter 11, Working with PhoneGap Plugins
Close
Chapter 11, Working with PhoneGap Plugins
by Giorgio Natili
PhoneGap 3 Beginner's Guide
PhoneGap 3 Beginner's Guide
Table of Contents
PhoneGap 3 Beginner's Guide
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action – heading
What just happened?
Pop quiz – heading
Have a go hero – heading
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with PhoneGap
PhoneGap and Apache Cordova
The evolution of PhoneGap from 1.4 to 3.x
A note about operating systems
A note about the command-line tool
Installing PhoneGap
Installing dependencies
Setting up your development environment
Time for action – setting up Android using PhoneGap 2.x
What just happened?
Time for action – setting up iOS using PhoneGap 2.x
What just happened?
Time for action – setting up Windows Phone using PhoneGap 2.x
What just happened?
Getting Started with Android and Eclipse
Time for action - installing ADT into Eclipse
What just happened?
Getting started with iOS and Xcode
Getting started with Windows Phone and Visual Studio
Creating a common code base for multiplatform apps
Summary
2. Building and Debugging on Multiple Platforms
Development tools
Sublime Text
IntelliJ IDEA
Adobe Brackets
Time for action – configuring the cloud service in Bracket
What just happened?
Eclipse
Native, web, and hybrid apps
Working with desktop browsers
WebKit debugging (Chrome, Safari, and Opera)
Gecko debugging (Firefox)
Internet Explorer 10
Mobile debugging workflow
Remote debugging
Using iWebInspector (OS X only)
Time for action – configuring iWebInspector for iOS debugging
What just happened?
Debugging with weinre
Time for action – configuring Node.js and weinre
What just happened?
Wireless debugging with Adobe Edge Inspect
Time for action – integrating Edge Inspect and weinre
What just happened?
iOS 6 remote debugging
Mimicking mobile counterparts
Have a go hero – improve the "Hello World" app
Pop quiz – getting started with mobile apps
Summary
3. Getting Started with Mobile Applications
Mobile-centric HTML/CSS/JavaScript
The viewport meta tag
Unwanted telephone number linking
Autocorrect
CSS media queries and mobile properties
JavaScript for mobile 101
querySelector and querySelectorAll
addEventListener
Screen orientation
Device orientation
Shake gestures
Media capture API
Data URI
Performance best-practices
Understanding screen size and pixel density
Time for action – scaling UI images according to pixel density
What just happened?
Writing effective JavaScript
Loose coupling
Event handling best practice
Choosing web app templates
HTML5 Mobile Boilerplate
Foundation
Bootstrap
jQuery Mobile
Which is the right one?
Setting up your project using cordova-cli
Time for action – installing cordova-cli using npm
What just happened?
Your first application – "Hello World"
Time for action – creating your first cross-platform app
What just happened?
Add interactivity to your app
Time for action – programmatically opening a modal window using Bootstrap
What just happened?
Achieving a native look and feel on iOS
Time for action – setting up a native-like CSS for your app
What just happened?
Have a go hero – improve the "Hello World" app
Pop quiz – getting started with mobile apps
Summary
4. Architecting Your Mobile App
Fine-tuning your development environment
Speeding up folder access with jump (OS X)
Creating a server alias with serve
Customizing your shell with iTerm2 (OS X)
Time for action – customizing the shell
What just happened?
Let LiveReload refresh pages for you (OS X)
Time for action – enabling Live Reload
What just happened?
Reviewing the JavaScript guidelines
Exploring the sample app
The navigation flow
The app architecture
Communication between modules
The anatomy of a module
Building the app's core
Bootstrap loader
Time for action – Require.js Bootstrap
What just happened?
Mustache templates
Time for action – creating a Mustache template
What just happened?
Template initialization
Time for action – loading and parsing a template
What just happened?
The splash screen
Time for action – adding a splash screen to your app
What just happened?
Have a go hero – preparing additional app assets
Pop quiz – getting started with mobile apps
Summary
5. Improving the User Interface and Device Interaction
Exploring JavaScript compression
Google Closure Compiler
Time for action – compressing files using the Closure Compiler
What just happened?
UglifyJS2
Time for action – using UglifyJS with the Closure Compiler
What just happened?
Optimization with Require.js
Time for action – optimizing JavaScript with Require.js
What just happened?
Comparing compression tools
Using template engine compression
Time for action – compiling a template using pistachio
What just happened?
Handling a retina display user interface
Time for action – user interface elements and retina display
What just happened?
Creating fluid, multiple app views
PhoneGap lifecycle events
Time for action – accessing the device API
What just happened?
App views
Time for action – creating the templates
What just happened?
Navigation between views
Using hardware-accelerated transitions
Alice.js
Getting started with the PhoneGap APIs
Exploring the Connection API
Pop quiz – getting started with mobile apps
Have a go hero – create a network detection utility
Summary
6. Using Device Storage and the Contacts API
Application data storage
Exploring the PhoneGap LocalStorage API
Time for action – reading and writing data on the LocalStorage
What just happened?
Exploring the PhoneGap SQL storage
Database storage with PhoneGap
Time for action – populating a local database
What just happened?
Database limitations
The Contacts API
The ContactName object
The ContactField object
The ContactAddress object
The ContactOrganization object
The Contact object
Filtering contact data
Time for action – filtering device contacts
What just happened?
Pop quiz – getting started with mobile apps
Have a go hero – create a Todo list app
Summary
7. Accessing Device Sensors
What are device sensors?
Sensors and human-computer interaction
Accelerometer
Detecting shakes
Time for action – detecting shakes in your app
What just happened?
Device orientation events
Handling orientation with JavaScript
Time for action – handling device orientation with JavaScript
What just happened?
Compass
Creating a compass
Time for action – using the Compass API
What just happened?
Pop quiz – getting started with mobile apps
Have a go hero – rendering the device orientation
Summary
8. Using Location Data with PhoneGap
An introduction to Geolocation
The PhoneGap Geolocation API
Time for action – showing device position with Google Maps
What just happened?
Other Geolocation data
Time for action – discovering places with Google Places
What just happened?
Pop quiz – getting started with mobile apps
Have a go hero – improving the Google API usage
Summary
9. Manipulating Files
Understanding the Files API
Reading directories and files
Time for Action – listing folders and files recursively
What just happened?
Writing and reading a file's data
Time for Action – reading and rendering an Image
What just happened?
Transferring files
Time for Action – downloading and saving a file
What just happened?
Pop quiz – working with files
Have a go hero – uploading files
Summary
10. Capturing and Manipulating Device Media
Camera API or Capture API?
Accessing the camera using the Camera API
Time for action – accessing the device camera
What just happened?
Controlling the camera popover
Time for action – controlling the position of the camera roll
What just happened?
The Capture API
Time for action – manipulating images with a canvas
What just happened?
Pop quiz – getting started with media
Have a go hero – applying effects
Summary
11. Working with PhoneGap Plugins
Introduction to plugins
Getting started with plugins
Using plugins with Plugman
The anatomy of a plugin
Working with plugins
The Push Notifications plugin
Time for action – using push notifications on Android
What just happened?
Pop quiz – getting started with PhoneGap plugins
Have a go hero – improving the push notifications example
Summary
A. Localizing Your App
Time for action – rendering localized messages
What just happened?
Summary
B. Publishing Your App
Publishing on Google Play
Publishing on the Blackberry World
Publishing on the Apple App Store
Publishing on the Windows Phone Store
Summary
C. Pop Quiz Answers
Chapter 2, Building and Debugging on Multiple Platforms
Pop quiz – getting started with mobile apps
Chapter 3, Getting Started with Mobile Applications
Pop quiz – getting started with mobile apps
Chapter 4, Architecting Your Mobile App
Pop quiz – getting started with mobile apps
Chapter 5, Improving the User Interface and Device Interaction
Pop quiz – getting started with mobile apps
Chapter 6, Using Device Storage and the Contacts API
Pop quiz – getting started with mobile apps
Chapter 7, Accessing Device Sensors
Pop quiz – getting started with mobile apps
Chapter 8, Using Location Data with PhoneGap
Pop quiz – getting started with mobile apps
Chapter 9, Manipulating Files
Pop quiz – working with files
Chapter 10, Capturing and Manipulating Device Media
Pop quiz – getting started with media
Chapter 11, Working with PhoneGap Plugins
Pop quiz – getting started with PhoneGap plugins
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Chapter 10, Capturing and Manipulating Device Media
Next
Next Chapter
Index
Chapter 11, Working with PhoneGap Plugins
Pop quiz – getting started with PhoneGap plugins
Q1
2
Q2
2
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset