i want the emulator to play an audio file from raw folder everytime it recieves a message
<p>i want the emmulator to play an audio file from raw folder everytime it recieves a message</p>

<pre><code>     public class SMSplayActivity extends BroadcastReceiver {
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
private MediaPlayer mPlayer;

public void onReceive(Context arg0, Intent arg1) {


    if (arg1.getAction() == SMS_RECEIVED) {

        mPlayer = MediaPlayer.create(arg0, R.raw.piya);
        mPlayer.start();
        mPlayer.setLooping(true);



    }       
}
</code></pre>

<p>Manifest file : </p>

<p>Have added the required in manifest file as well </p>

<p></p>

<pre><code>        &lt;receiver android:name="SMSplayActivity"&gt;
            &lt;intent-filter &gt;
                &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt;

            &lt;/intent-filter&gt;

        &lt;/receiver&gt;
</code></pre>

<p>HOw do i go about with this ??</p>
