正在加载图片...
Step 1:Create the raw folder in the project and put the media file into the folder Step 2:Configure the media player object ServiceAndMediaPlayer ·售sc to start the media playback com.example.serviceandmediaplayer gen [Generated Java Files] D☐Android4.4w /Create an instance of MediaPlayer and load the music Android Private Libraries MediaPlayermediaPlayerMediaPlayer.create(this, Android Dependencies 凸assets R.raw.music)j bin /Start the media playback D邑bs mediaPlayer.start(); ·是res drawable-hdpi drawable-ldpi drawable-mdpi To replay the media,call reset()and drawable-xhdpi drawable-xxhdpi prepare() raw To pause,call pause() music.mp3 values ·To stop,call stop() values-v11 evalues-v14 AndroidManifest.xml ic_launcher-web.png MediaPlayer class reference: clint.xml http://developer.android.com/reference/android/media/Media proguard-project.txt 目project.properties Player.html 8 // Create an instance of MediaPlayer and load the music MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.music); // Start the media playback mediaPlayer.start(); Step 1: Create the raw folder in the project and put the media file into the folder Step 2: Configure the media player object to start the media playback • To replay the media, call reset() and prepare() • To pause, call pause() • To stop, call stop() MediaPlayer class reference: http://developer.android.com/reference/android/media/Media Player.html
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有