Android Tutorial

(avery) #1

By : Ketan Bhimani


70 

Log.i(DEBUG_TAG, “Info about MyFirstAndroidApp”);

Now you’re ready to run MyFirstAndroidApp. Save your work and
debug it in the emulator. You notice that your logging messages
appear in the LogCat listing, with the Tag field MyFirstAppLogging.

A Filtered LogCat log for My First Android App.

Adding Some Media Support to Your Application

Next, let’s add some pizzazz to MyFirstAndroidApp by having the
application play an MP3 music file. Android media player features
are found in the MediaPlayer

class of the android.media package.

You can create MediaPlayer objects from existing application
resources or by specifying a target file using a Uniform Resource
Identifier (URI). For simplicity, we begin by accessing an MP3 using
the Uri class from the android.net package.

Some methods in the android.media.MediaPlayer and
android.net.Uri classes are shown in Table.
Free download pdf