O'Reilly logo

PhoneGap Essentials: Building Cross-Platform Mobile Apps by John M. Wargo

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

11. Camera

The PhoneGap Camera API provides an application with the ability to work with images, either captured directly from the camera or retrieved from the device’s photo repository. When retrieving an image, the API can return either a URI pointing to the image file on the device’s file system or the base64-encoded string representing the content from the image.

The API provides a single method, navigator.camera.getPicture, which is used to retrieve an image, and a cameraOptions object that’s used to define parameters around how the image is obtained, how it’s formatted, and more.

Applications can also use the PhoneGap Capture API to capture images using the camera. Refer to Chapter 12 for more information about this API. The Camera and ...

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

Start Free Trial

No credit card required