Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

Exploring the Device API


Since we have covered the basics of using plugins in a Cordova/PhoneGap project, we will now look at an example of how to use the Device plugin.

Device API is one of the simplest APIs of PhoneGap/Cordova, which provides you with details about the device on which it's running. This is a great API to try when you first learn about plugins. Using the API, you can get the following properties of the device:

  • Device platform

  • Device unique ID

  • Device version number

  • Device model name

You can use these properties to provide device-specific features to the users.