Recently I was doing a app about play the internet radio in android, as if the android can't play the url source directly when set the url to setDatasource();
1.i use the downLoadFile function to download the stream file into the cache and save as the temp file for playing;the file is saved in name downloadingMedia_0.dat,downloadingMedia_1.dat...and the like
2.when i note the downloadingMedia_0.dat have the initByteLength and i play it, when it plays and has a little time left ,i will play the downloadingMedia_1.dat file,in the same time ,i will delete the downloadingMedia_0.dat, the logic is easy i think.
3. you can change the URL1 variables in the main activity for testing.
now my questions is:
1. i can't make the downloadingMedia_0.dat,downloadingMedia_1.dat can play seamless, maybe the checkMediaPlayer1（）,checkMediaPlayer2（）i need to change the condition in if;
2. how did i handle the file i saved in the cache and can play the stream smoothly.
thanks in advance Everyone!
the attachment you can download for a test and give me your good ideas!