Created
October 10, 2010 00:35
-
-
Save pbrisbin/618771 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package rawAudio.apk; | |
| import java.io.IOException; | |
| import android.app.ProgressDialog; | |
| import android.app.Service; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.media.MediaPlayer; | |
| import android.os.Binder; | |
| import android.os.Handler; | |
| import android.os.IBinder; | |
| import android.os.Message; | |
| import android.util.Log; | |
| public class StreamMusic extends Service { | |
| private static final String APP = "StreamMusic"; | |
| private static MediaPlayer mediaPlayer = null; | |
| private static String STREAM = ""; | |
| private final Binder binder = new LocalBinder(); | |
| private ProgressDialog pd; | |
| @Override public IBinder onBind(Intent intent) { | |
| return(binder); | |
| } | |
| @Override public void onDestroy() { | |
| // stop the music | |
| mediaPlayer.stop(); | |
| mediaPlayer = null; | |
| super.onDestroy(); | |
| } | |
| public class LocalBinder extends Binder { | |
| StreamMusic getService() { | |
| return (StreamMusic.this); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment