blob: 9391449b57e239479dd818e585a27625c8a603c0 [file] [log] [blame]
Scott Main7736f962011-12-15 15:40:25 -08001page.title=Managing Audio Playback
Joe Fernandez33baa5a2013-11-14 11:41:19 -08002page.tags=audio,media
Scott Main604e4ed2011-12-13 18:24:34 -08003
4trainingnavtop=true
5startpage=true
Scott Main604e4ed2011-12-13 18:24:34 -08006
7@jd:body
8
9<div id="tb-wrapper">
10<div id="tb">
11
12<h2>Dependencies and prerequisites</h2>
13<ul>
14 <li>Android 2.0 (API level 5) or higher</li>
15 <li>Experience with <a href="{@docRoot}guide/topics/media/mediaplayer.html">Media
16Playback</a></li>
17</ul>
18
19<h2>You should also read</h2>
20<ul>
Scott Main50e990c2012-06-21 17:14:39 -070021 <li><a href="{@docRoot}guide/components/services.html">Services</a></li>
Scott Main604e4ed2011-12-13 18:24:34 -080022</ul>
23
24</div>
25</div>
26
27
28<p>If your app plays audio, its important that your users can control the audio in a predictable
29manner. To ensure a great user experience, its also important that your app manages the audio focus
30to ensure multiple apps arent playing audio at the same time.</p>
31
32<p>After this class, you will be able to build apps that respond to hardware audio key presses,
33which request audio focus when playing audio, and which respond appropriately to changes in audio
34focus caused by the system or other applications.</p>
35
36
37
38
39<h2>Lessons</h2>
40
41<!-- Create a list of the lessons in this class along with a short description of each lesson.
42These should be short and to the point. It should be clear from reading the summary whether someone
43will want to jump to a lesson or not.-->
44
45<dl>
46 <dt><b><a href="volume-playback.html">Controlling Your Apps Volume and
47Playback</a></b></dt>
48 <dd>Learn how to ensure your users can control the volume of your app using the hardware or
49software volume controls and where available the play, stop, pause, skip, and previous media
50playback keys.</dd>
51
52 <dt><b><a href="audio-focus.html">Managing Audio Focus</a></b></dt>
53 <dd>With multiple apps potentially playing audio it's important to think about how they should
54interact. To avoid every music app playing at the same time, Android uses audio focus to moderate
55audio playback. Learn how to request the audio focus, listen for a loss of audio focus, and how to
56respond when that happens.</dd>
57
58 <dt><b><a href="audio-output.html">Dealing with Audio Output Hardware</a></b></dt>
59 <dd>Audio can be played from a number of sources. Learn how to find out where the audio is being
60played and how to handle a headset being disconnected during playback.</dd>
Joe Fernandez33baa5a2013-11-14 11:41:19 -080061 </dl>