开发者

How to include a file to my app

I want to play a alarm on my app so i need to know how to inc开发者_开发知识库lude it and to access


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜