Chapter 10. Android Camera, Camera Roll, and Microphone

WHAT'S IN THIS CHAPTER?

  • Accessing the camera

  • Using the camera roll

  • Working with the microphone

AIR for Android enables you to go beyond the URL-based integration that I discussed back in Chapter 9. You can also integrate directly with core parts of the Android device. In this chapter, I'll show you how you can work with the Camera, the Camera Roll, and the Microphone inside of your Flash apps.

Note that each of the four sample apps I cover are based on the AndroidAppTemplate.fla. So, to ensure identical results, be sure to download the AndroidAppTemplate.fla from the book's website before beginning to code these examples.

Note

At the time of writing this book, Adobe Flash's iPhone support does not include support for the features covered in this chapter. However, in the event that Adobe revises the Packager for iPhone in the future, I am anticipating that the AIR for Android API discussed in this chapter will be quite similar in support.

CAMERAUI: LAUNCH AND RETURN

You use the CameraUI class to access the still camera and video cam of an Android device. You can then use this class to launch the built-in camera, enable the user to take a picture, automatically save the file, and return the user to your app. Table 10-1 shows the details of the CameraUI class.

Table 10.1. CameraUI Members

MEMBER

DESCRIPTION

CameraUI()

Constructor

isSupported()

Indicates whether CameraUI is supported on the device

launch(MediaType.IMAGE | MediaType.VIDEO)

Launches ...

Get Professional Flash® Mobile Development: Creating Android™ and iPhone® 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.