Skip to Content
Professional Android Programming with Mono for Android and .NET/C#
book

Professional Android Programming with Mono for Android and .NET/C#

by Wallace B. McClure, Nathan Blevins, John J. Croft IV, Jonathan Dick, Chris Hardy
April 2012
Intermediate to advanced
552 pages
14h 22m
English
Wrox
Content preview from Professional Android Programming with Mono for Android and .NET/C#

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android Wireless Application Development

Android Wireless Application Development

Shane Conder, Lauren Darcey
Learning Android

Learning Android

Marko Gargenta
Mono: A Developer's Notebook

Mono: A Developer's Notebook

Edd Wilder-James, Niel M. Bornstein

Publisher Resources

ISBN: 9781118026434Purchase book