Code example for MediaRecorder

Methods: preparesetPreviewDisplay

0
		recorder.setMaxDuration(50000); // 50 seconds
		recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
	} 
 
	private void prepareRecorder() { 
		recorder.setPreviewDisplay(holder.getSurface());
 
		try { 
			recorder.prepare();
		} catch (IllegalStateException e) {
			e.printStackTrace();
			finish();
		} catch (IOException e) {
			e.printStackTrace();
			finish();
		} 
	} 
 
	public void onClick(View v) {
		if (recording) {
Stop searching for code, let great code find you!  Add Codota to your java IDE