Androidで音楽再生 アプリケーション機能 上ボタンを押すとウィンドウズの警告音がなる 下ボタンを押すと音楽再生 センターボタンを押すと音楽停止 準備 適当な音楽ファイルを用意する Andoroidのオーディオサポートフォーマット wav aac mp3 wma amr ogg midi プロジェクト概要 プロジェクト名:SoundSample BuildTarget:sdk1.5 追加リソース 「res」フォルダ以下に「raw」フォルダ 「raw」フォルダ以下に「sample.mp3」ファイル プログラム作成 MediaPlayerの作成 MediaPlayerオブジェクトをprivateで定義する private MediaPlayer sample; MediaPlayerのインスタンス作成し、sample.mp3で初期化 this.sample = MediaPlayer.cr