开发者

How to include a file to my app

开发者 https://www.devze.com 2023-01-13 17:40 出处:网络
I want to play a alarm on my app so i need to know how to inc开发者_开发知识库lude it and to accessYou want to include the file as a resource. See Providing Resources.put your media file (alarm.mp3) i

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

精彩评论

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