Android Programming




       Lesson 14

Multimedia Programming
      NGUYEN The Linh
Android Programming


Contents

       1   Media Playback

       2   Audio Capture

       3   JetPlayer


       4   Camera


       5   Creating Sound Effects


                           2
Android Programming


Multimedia Programming




             Media Playback




                   3
Android Programming


Media Playback

 The Android multimedia framework includes support for
  playing variety of common media types, so that you can
  easily integrate audio, video and images into your
  applications.

 You can play audio or video from media files stored in your
  application's resources (raw resources), from standalone files
  in the file system, or from a data stream arriving over a
  network connection, all using MediaPlayer APIs.



                              4
Android Programming


Media Playback

 http://developer.android.com/guide/topics/media/mediaplay
  er.html




                            5
Android Programming


Multimedia Programming




             Audio Capture




                   6
Android Programming


Audio Capture

 The Android multimedia framework includes support for
  capturing and encoding a variety of common audio formats,
  so that you can easily integrate audio into your applications.



 You can record audio using the MediaRecorder APIs if
  supported by the device hardware.




                              7
Android Programming


Audio Capture

 http://developer.android.com/guide/topics/media/audio-
  capture.html




                            8
Android Programming


Multimedia Programming




               JetPlayer




                   9
Android Programming


JetPlayer

 The Android platform includes a JET engine that lets you add
  interactive playback of JET audio content in your
  applications.

 You can create JET content for interactive playback using the
  JetCreator authoring application that ships with the SDK.

 To play and manage JET content from your application, use
  the JetPlayer class.



                             10
Android Programming


JetPlayer

 http://developer.android.com/guide/topics/media/jetplayer.h
  tml




                            11
Android Programming


Multimedia Programming




                Camera




                  12
Android Programming


Camera

 The Android framework includes support for various cameras
  and camera features available on devices, allowing you to
  capture pictures and videos in your applications.

 The Android framework supports capturing images and video
  through the Camera API or camera Intent. Here are the
  relevant classes:
    Camera: This class is the primary API for controlling device
     cameras. This class is used to take pictures or videos when you
     are building a camera application.


                                13
Android Programming


Camera

   SurfaceView: This class is used to present a live camera preview
    to the user.

   MediaRecorder: This class is used to record video from the
    camera.

   Intent: An intent action type
    of MediaStore.ACTION_IMAGE_CAPTURE or MediaStore.ACTI
    ON_VIDEO_CAPTURE can be used to capture images or videos
    without directly using the Camera object.

                               14
Android Programming


Camera

 http://developer.android.com/guide/topics/media/camera.ht
  ml




                            15
Android Programming


Multimedia Programming




          Creating Sound Effects




                   16
Android Programming


Creating Sound Effects

 http://developer.android.com/reference/android/media/Sou
  ndPool.html




         SoundPool                   MediaPlayer




                           17
Android Programming


Creating Sound Effects

 SoundPool
    SoundPool is designed for short files which can be kept in
     memory decompressed for quick access, this is best suited for
     sound effects in apps or games.

 MediaPlayer
   MediaPlayer is designed for longer sound files or streams, this
    is best suited for music files or larger files. The files will be
    loaded from disk each time create is called, this will save on
    memory space but introduce a small delay (not really
    noticeable).
                                  18
Android Programming

[Android] Multimedia Programming