Exception while calling prepare in media player

Put your problem here if it does not fit any of the other categories.

Exception while calling prepare in media player

Postby kartik_saltriver » Thu Apr 16, 2009 1:34 pm

Hello, I am using linux so i have installed Android in it. I am getting the exception while calling prepare() from MediaPlayer object. The following is my code.


File bufferedFile = new File(context.getCacheDir(),"playingMedia" + (counter++) + ".dat");

moveFile(downloadingMediaFile,bufferedFile);

Log.e("Player",bufferedFile.length()+"");
Log.e("Player",bufferedFile.getAbsolutePath());

mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(bufferedFile.getAbsolutePath());
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
System.out.println("before preapare");
mediaPlayer.prepare();

I am adding the code tutoril also so if any one of you have few minutes then please check it. Accoridng to my opiong it i facing some problem in accessing file system so. Can some one tell me what could be wrong in it ?

another thing which i want to know is Can some one tell me context.getCacheDir()
Attachments
tutorial3.zip
(130 KiB) Downloaded 73 times
kartik_saltriver
Freshman
Freshman
 
Posts: 7
Joined: Wed Apr 01, 2009 5:50 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 19 guests