MarcC wrote:
> Do you happen to know where I can find an example of MediaPlayer as a
> Service?

I suspect the built in Music app works that way. In general, though,
MediaPlayer isn't activity-specific, so it should work in a service just
as it would in an activity. You might want to use the new
startForeground() method, though, to keep it playing and put a
Notification in the status bar at the same time.

> The examples I found had a single audio being played and
> stopped via the service and I could not figure out how to add more
> than one audio file.

Register a listener with the MediaPlayer and kick off the next file. If
the gap becomes a problem, consider using two MediaPlayers, working
back-to-back -- when #1 stops, you start #2 while doing prepareAsuync()
on #1 to ready it for the next go-around.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Beginning Android_ from Apress Now Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to