Code example for Time

Methods: format2445, setToNow

0
	// Existing files are silently overwritten! 
	public CallRecorder(String filename,int sample_rate)
	{ 
		if (filename == null)
		{ 
			Time t = new Time();
			t.setToNow();
			filename = t.format2445(); // Create filename from current date.
		} 
		 
		// Make sure directory exists. 
		File dir = new File("/sdcard/Sipdroid_Recordings/");
		dir.mkdirs();
		 
		// If this fails, all of the other calls just silently return immediately. 
		callWav = new WavWriter("/sdcard/Sipdroid_Recordings/" + filename + ".wav",sample_rate);
	} 
	 
	// Write data received from the internet. 
	public void writeIncoming(short[] buffer, int offs, int len)
	{