O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

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

20Camera II: Taking Pictures and Handling Images

In this chapter, you will capture an image from the camera’s preview and save it as a JPEG on the filesystem. Then you will associate that JPEG with a Crime and display it in CrimeFragment’s view. You will also offer the user the option to view a larger version of the image in a DialogFragment.

Figure 20.1  Crime photo thumbnail and larger-size images

Crime photo thumbnail and larger-size images

Taking a Picture

First, you are going to update CrimeCameraFragment’s layout to include a progress indicator. Sometimes the picture-taking process can take a while, and you do not want users getting antsy.

In layout/fragment_crime_camera.xml, add the ...

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