package com.android.mp3;
import java.io.IOException;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Binder;
import android.os.IBinder;
import android.os.Parcel;
import android.widget.Toast;
public class Mp3Service extends Service {
MediaPlayer mp = new MediaPlayer();
Binder binder = new Binder();
@Override
public IBinder onBind(Intent intent)
{ return binder; }
@Override public void onStart(Intent intent, int startId)
{
super.onStart(intent, startId);
try{ mp.reset();
mp.setDataSource("/sdcard/music/NishinoKana_MAYBE.mp3");
mp.prepare();
mp.start();
} catch (IOException e){
e.printStackTrace();
}
public void onDestroy(){
super.onDestroy();
mp.stop();
로그인 유지
제가 짠 소스는 아니구 만드신 분께 감사를~
(근데 답변에 소스를 다올려도 되는지 모르겠네요. 괜찮겠지요?)