" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi
** Since we can’t play .caf file in android device . This method download the audio file (.caf file ) as a .mp4 file and can be played in android device.**/ .
public boolean writeToSdCard(String url, String filename)
java.io.InputStream is = (java.io.InputStream) (new URL(url).getContent());
BufferedInputStream bis = new BufferedInputStream(is);
ByteArrayBuffer baf = new ByteArrayBuffer(4000);
int current = 0;
while ((current = bis.read()) != -1)
FileOutputStream fos = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + filename);
catch (MalformedURLException e)
catch (IOException e)
Mail (will not be published) (required)
Enter Captcha Code *
2 + = five
Burn Ignorance is a knowledge initiative by Mindfire Solutions
Subscribe to our mailing list to get the updates to your email inbox...