is there anyway to play a file that is being dynamically added to, using android media player ?
I tried using RandomAccessFile :
public static RandomAccessFile tempMp3;
tempMp3 = new RandomAccessFile(Environment.getExternalStorageDirectory()+"/ggg", "rw");
StaticData.tempMp3.setLength(file_size);
StaticData.tempMp3.seek(0);
//Here I call the auto update function and after X bytes are written I call playMediaPlayer
StaticData.mediaPlayer.setDataSource(StaticData.tempMp3.getFD());
StaticData.mediaPlayer.prepare();
StaticData.mediaPlayer.start();
So basically I am updating and playing at the same time. The problem is that MediaPlayer and my Update function both are accessing and moving the file pointer, which messes up the MediaPlayer.
Is there any workaround ? Can I use separate file pointers ?