1
URL에서 스트리밍하는 뮤직 앱을 개발했습니다. 와이파이 연결에 잘 작동하는 것 같다하지만 (노래가 재생되지 않습니다 IE)안드로이드의 스트림 음악이 wifi가 아닌 모바일 데이터를 사용합니다.
private OnClickListener TumHiHo = new OnClickListener() {
@Override
public void onClick(View v) {
if (!playPauseTumHiHo) {
tumhihobtn.setBackgroundResource(R.drawable.button_pause);
if (initialStartTumHiHo)
{ mediaPlayer.stop();
mediaPlayer.reset();
initialStartSunRahaHaiNa=true;
initialStartTumHiHo=false;
new Player()
.execute("http://sound30.mp3slash.net/indian/aashiqui2/[Songs.PK]%20Aashiqui%202%20-%2001%20-%20Tum%20Hi%20Ho.mp3");
loadDocTumHiHo();
chkStatus();
}else {
if (!mediaPlayer.isPlaying())
mediaPlayer.start();
}
playPauseTumHiHo = true;
} else {
tumhihobtn.setBackgroundResource(R.drawable.button_play);
if (mediaPlayer.isPlaying())
mediaPlayer.pause();
playPauseTumHiHo = false;
}
}
};
chkStatus()가 있는지 여부를 테스트하는 것입니다은 - 재생/일시 정지 버튼의 OnClickListener를 내부에 모바일 3G에 국지적 인 코드를 버퍼링하지 않습니다 사용자가 모바일 데이터 또는 Wi-Fi를 사용 중입니다.
매니페스트 파일 has-
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
표시된 로그 캣 나는 문제가 내 모바일의 네트워크 또는 응용 프로그램과인지 모르는
12-12 22:22:23.906: V/MediaPlayer(400): stop
12-12 22:22:23.906: E/MediaPlayer(400): stop called in state 0
12-12 22:22:23.906: V/MediaPlayer(400): message received msg=100, ext1=-38, ext2=0
12-12 22:22:23.906: E/MediaPlayer(400): error (-38, 0)
12-12 22:22:23.906: V/MediaPlayer(400): callback application
12-12 22:22:23.906: V/MediaPlayer(400): back from callback
12-12 22:22:23.906: V/MediaPlayer-JNI(400): reset
12-12 22:22:23.906: V/MediaPlayer(400): reset
12-12 22:22:49.171: V/MediaPlayer-JNI(400): stop
12-12 22:22:49.176: V/MediaPlayer(400): stop
12-12 22:22:49.176: E/MediaPlayer(400): stop called in state 1
12-12 22:22:49.176: V/MediaPlayer(400): message received msg=100, ext1=-38, ext2=0
12-12 22:22:49.176: E/MediaPlayer(400): error (-38, 0)
12-12 22:22:49.176: V/MediaPlayer(400): callback application
12-12 22:22:49.176: V/MediaPlayer(400): back from callback
12-12 22:22:49.176: V/MediaPlayer-JNI(400): reset
12-12 22:22:49.176: V/MediaPlayer(400): reset
12-12 22:22:49.241: W/ResourceType(400): Failure getting entry for 0x010802c1 (t=7 e=705) in package 0 (error -75)
12-12 22:22:49.251: D/dalvikvm(400): GC_CONCURRENT freed 55K, 11% free 10620K/11847K, paused 16ms+7ms, total 51ms
12-12 22:22:49.306: V/MediaPlayer(400): setVideoSurfaceTexture
12-12 22:22:49.306: V/MediaPlayer(400): prepare
12-12 22:22:52.266: V/MediaPlayer(400): message received msg=100, ext1=1, ext2=-1004
12-12 22:22:52.266: E/MediaPlayer(400): error (1, -1004)
12-12 22:22:52.266: V/MediaPlayer(400): signal application thread
12-12 22:22:52.266: V/MediaPlayer(400): prepare complete - status=1
12-12 22:22:52.281: W/System.err(400): java.io.IOException: Prepare failed.: status=0x1
12-12 22:22:52.281: W/System.err(400): at android.media.MediaPlayer.prepare(Native Method)
12-12 22:22:52.291: W/System.err(400): at com.bignerdranch.android.lyrischemusik1.MusikActivity4$Player.doInBackground(MusikActivity4.java:235)
12-12 22:22:52.291: W/System.err(400): at com.bignerdranch.android.lyrischemusik1.MusikActivity4$Player.doInBackground(MusikActivity4.java:1)
12-12 22:22:52.296: W/System.err(400): at android.os.AsyncTask$2.call(AsyncTask.java:287)
12-12 22:22:52.296: W/System.err(400): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
12-12 22:22:52.296: W/System.err(400): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
12-12 22:22:52.296: W/System.err(400): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
12-12 22:22:52.296: W/System.err(400): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
12-12 22:22:52.296: W/System.err(400): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
12-12 22:22:52.301: W/System.err(400): at java.lang.Thread.run(Thread.java:856)
12-12 22:22:52.346: D/Prepared(400): //false
12-12 22:22:52.346: V/MediaPlayer-JNI(400): start
12-12 22:22:52.346: V/MediaPlayer(400): start
12-12 22:22:52.346: E/MediaPlayer(400): start called in state 0
12-12 22:22:52.346: V/MediaPlayer(400): message received msg=100, ext1=-38, ext2=0
12-12 22:22:52.346: E/MediaPlayer(400): error (-38, 0)
12-12 22:22:52.346: V/MediaPlayer(400): callback application
12-12 22:22:52.346: V/MediaPlayer(400): back from callback
12-12 22:22:52.401: E/MediaPlayer(400): Error (-38,0)
12-12 22:22:52.406: V/MediaPlayer-JNI(400): stop
12-12 22:22:52.406: V/MediaPlayer(400): stop
12-12 22:22:52.406: E/MediaPlayer(400): stop called in state 0
12-12 22:22:52.406: V/MediaPlayer(400): message received msg=100, ext1=-38, ext2=0
12-12 22:22:52.406: E/MediaPlayer(400): error (-38, 0)
12-12 22:22:52.406: V/MediaPlayer(400): callback application
12-12 22:22:52.406: V/MediaPlayer(400): back from callback
12-12 22:22:52.406: V/MediaPlayer-JNI(400): reset
12-12 22:22:52.406: V/MediaPlayer(400): reset
된 직후입니다. 앱이라면 어디서 잘못 될지 알려주세요. 미리 감사드립니다.