PhoneGap Essentials
eBook - ePub

PhoneGap Essentials

Ivan Turkovic

Partager le livre
  1. 178 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

PhoneGap Essentials

Ivan Turkovic

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Use PhoneGap to build cross-platform mobile applications quickly and efficiently

About This Book

  • Build native mobile phone applications with HTML5, JavaScript, and CSS
  • Incorporate smartphone capabilities such as GPS, camera, accelerometer, and more into your apps for any mobile platform
  • Use Cordova view to embed PhoneGap into native applications to either transit smoothly to PhoneGap or incorporate PhoneGap functionalities

Who This Book Is For

If you are a mobile application developer in iOS or Android, or a web application developer who wants to learn how to make cross-platform mobile applications using PhoneGap, this book is perfect for you. To make the most of this book, it will be helpful if you have prior knowledge of HTML5, CSS, and JavaScript.

What You Will Learn

  • Get to grips with the fundamentals of PhoneGap to get started
  • Set up a development environment for Linux, Mac OS, and Windows
  • Use Cordova CLI, workflows, and Plugman Plugin manager to create mobile applications efficiently
  • Understand the development workflow to create native cross-platform mobile applications
  • Embed plugin support to transition to PhoneGap or use it to enhance existing applications
  • Improve your mobile development knowledge using object-oriented programming (OOP), reusable components, and AJAX closures
  • Be empowered to build your own mobile apps quickly with ease
  • Discover tips and tricks to make app development fun and easy

In Detail

PhoneGap is an open source framework that allows you to quickly build cross-platform mobile apps using HTML5, JavaScript, and CSS. PhoneGap Build is a cloud service that allows you to quickly develop and compile mobile applications without SDKs, compilers, and hardware. PhoneGap allows you to use its existing plugins or create new ones, as per your requirements, to enhance your mobile applications.

Starting by installing PhoneGap, you'll develop an app that uses various device capabilities through different plugins and learn how to build an app in the cloud with PhoneGap's Build service.

You'll discover how to use PhoneGap to create an application view, along with how to use a camera, geolocation, and other device capabilities to create engaging apps. Next, you'll augment applications with PhoneGap's plugins using minimalistic code. You'll explore the app preparation process to deploy your app to the app store.

By the end of the book, you'll have also learned how to apply hybrid mobile UIs that will work across different platforms and different screen sizes for better user experience.

Style and approach

This is an example-based, fast-paced guide that covers the fundamentals of creating cross-platform mobile applications with PhoneGap.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que PhoneGap Essentials est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  PhoneGap Essentials par Ivan Turkovic en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatik et Programmierung von MobilgerĂ€ten. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2015
ISBN
9781785284687

PhoneGap Essentials


Table of Contents

PhoneGap Essentials
Credits
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
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Get up and Running with PhoneGap
A brief history
What is PhoneGap?
Where can it be used?
What PhoneGap is not
Competition
PhoneGap or Cordova?
Setting up a local development environment
Mac OS
Linux
Windows
Summary
2. Mobile Platform Support
Supported platforms
Supported features by platform
Support for development
PhoneGap Build
Platform support
Using PhoneGap Build
The PhoneGap Developer App
How to use it
Summary
3. Command-line Interface
Introduction to a command-line interface
PhoneGap CLI versus Cordova CLI
Installing the PhoneGap CLI
Creating a new project
Creating a Hello project
Creating a new project
Managing platforms
Adding a platform
Listing platforms
Removing a platform
Keeping platforms up-to-date
Application description
Creating a project from a template
Managing the project
Application preview
Preparing an application
Compiling an application
Building an application
Running an application
Emulating an application
Using PhoneGap Build
Authentication
Preparing the application
Building the application
Summary
4. Plugin Support
Introducing plugins
What is a plugin?
Support for different mobile platforms
Installing plugins
Command-line Interface
Finding plugins
Adding plugins
Listing plugins
Removing plugins
Plugman
Installing Plugman
Searching for plugins
Installing plugins
Removing plugins
npm
Plugins
Battery Status
Camera
Contacts
Device
The Device Motion plugin
Device position orientation
Dialogs
FileSystem
File Transfer
Geolocation
Globalization
InAppBrowser
Media
Media Capture
Network Information
Splashscreen
Vibration
StatusBar
Summary
5. First PhoneGap Application
Starting a new application
Creating a new application
Setting up the initial code
Project folder structure
Core PhoneGap events
The deviceready event
The pause event
The resume event
Essential plugins
The Device plugin
The Network Information plugin
The StatusBar plugin
The Dialogs plugin
Summary
6. Accessing Native APIs
Native APIs
Device status plugins
Motion sensing plugins
Media functionality plugins
Notification plugins
The Battery Status plugin
The Battery Status event
The Low Battery event
The Critical Battery event
The Device Motion plugin
The getCurrentAcceleration method
watchAcceleration
clearWatch
The Device Orientation plugin
getCurrentHeading
watchHeading
clearWatch
The Geolocation plugin
getCurrentPosition
watchPosition
clearWatch
The Position object
The Coordinates object
The Vibration plugin
Vibrate
Standard vibrate
Vibrating with a pattern (Android and Windows only)
Cancelling the vibration (not supported in iOS)
Summary
7. Accessing Media Content
Introducing multimedia
Media
File management
Contacts
File Transfer
The FileTransfer object
The FileUploadResult object
Upload
Download
Abort
Contacts
Contact
The Contact object
ContactName
ContactField
ContactAddress
ContactOrganization
The create method
Find
pickContact
Camera
getPicture
cleanup
InAppBrowser
The InAppBrowser object
The InAppBrowserEvent object
Open
Summary
8. Application Development Workflow
An introduction to a development workflow
Web project development
Native platform development
Best practices
Use local assets for the UI
Network access for data
Non-blocking UI
CSS animations
Click events
Performance
Optimize the image assets
Offline status
Load only what you need
Transparency
JSHint
Testing
Debugging
Desktop browsers
The PhoneGap emulator
Weinre
iOS Debugging
Xcode
Safari Remote Debugging
Android debugging
User interface
Summary
Index

PhoneGap Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2015
Production reference: 1310815
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-468-7
www.packtpub.com

Credits

Author
Ivan Turkovic
Reviewers
Johnathan Iannotti
Yousuf Qureshi
Anthony Rumsey
Kasper Souren
Tomasz Trejderowski
Commissioning Editor
Neil Alexander
Acquisition Editor
Subho Gupta
Content Development Editor
Manasi Pandire
Technical Editor
Bharat Patil
Copy Editors
Stephen Copestake
Tasneem Fatehi
Project Coordinator
Suzann...

Table des matiĂšres