O'Reilly logo

Professional Android Programming with Mono for Android and .NET/C# by Chris Hardy, Jonathan Dick, John J. Croft IV, Nathan Blevins, Wallace B. McClure

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

Chapter 9

Using Multimedia — Audio, Video, and the Camera

What's in This Chapter?

  • Playing audio and video
  • SurfaceView and video playback
  • Recording audio and video
  • Recording video and taking pictures
  • Reading and modifying image exif data
  • Adding media to the media store
  • Using voice recognition

Multimedia generally encompasses all the fun, non-text content: pictures, sound, video, and the like. This chapter shows you how to deal with this content in Mono for Android. Android takes its open philosophy into the realm of multimedia and has no bias for media providers. This ensures a broad range of support for image, audio, and video formats, which can be accessed locally or streamed to the device.

This chapter focuses on playing and recording audio and video using the available APIs. This chapter also covers voice input for your applications.

To effectively run the sample code in this chapter, you will need to use an actual Android device, as the emulator does not support the camera and those examples that use the camera will fail.

Android Media Classes

The following table provides a list of the Android media classes that are wrapped by Mono for Android to perform the magic in this chapter. Also, you will use the MediaPlayer and MediaRecorder along with the ExifInterface in examples in this chapter.

Table 9.1: Android Media Classes

Class Description
AsyncPlayer Plays an audio URI, but loading and preparing the audio is done on a background thread to prevent the foreground thread ...

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