tags:

views:

37

answers:

2

I want to play a alarm on my app so i need to know how to include it and to access

A: 

You want to include the file as a resource. See Providing Resources.

Mayra
thanks so now i have InputStream is = Resources.getSystem().openRawResource(R.raw.alarm); but how can i access the file with the media player?
Hans Wurst
You can create a media player instance with a reference to a resource id: http://developer.android.com/reference/android/media/MediaPlayer.html#create%28android.content.Context,%20int%29
Mayra
A: 

put your media file (alarm.mp3) inside your res/raw folder.

   MediaPlayer mp = MediaPlayer.create(this, R.raw.alarm);
    mp.start();

Here´s the documentation Audio and Video Playback

Jorgesys