Displaying a Photograph in Your Application

Another option is to embed the photo taken into a view inside the app, and this option requires more code. Using the APIs of the Camera class, you can integrate into your app the entire photo-taking process from preview to editing. The Camera class lets you set image capture settings, start and stop previews, take pictures, and even retrieve frames for video. Remember, this functionality can be difficult to test without an actual device, because the Android SDK does not provide full support for a device camera.

First, you need to create the photo activity that contains a button that you can use to take a photo in the photo application.

1. Using the Android Activity wizard, create a new Activity named ...

Get Learning Android™ Application Programming: A Hands-On Guide to Building Android Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.