Using the Media APIs

Android supports playing audio and video content under the package. In this chapter, we are going to explore the media APIs from this package.

At the heart of the package is the class. The MediaPlayer class is responsible for playing both audio and video content. The content for this class can come from the following sources:

  • Web: You can play content from the Web via a URL.
  • .apk file: You can play content that is packaged as part of your .apk file. You can package the media content as a resource or as an asset (within the assets folder).
  • SD card: You can play content that resides on the device's SD card.

The MediaPlayer is capable of decoding quite a few different content ...

Get Pro Android 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.