Sound Recorder In Android Development

This example shows how to record sound and save it to SD card it.

Algorithm:

1.) Create a new project by File-> New -> Android Project name it SoundRecorder.

2.) Write following into main.xml:

 

 

 

3.) Write following into manifest file:

 

 

 

4.) Run for output.

Steps:

1.) Create a project named SoundRecorder and set the information as stated in the image.

Build Target: Android 4.0
Application Name: SoundRecorder
Package Name: com. example. SoundRecorder
Activity Name: SoundRecorder
Min SDK Version: 8

2.) Open SoundRecorder.java file and write following code there:

 

 

 

3.) Compile and build the project.

Output

Leave a Comment:

9 comments
Navdeep says September 1, 2012

Can we control in which format files are saved??

Reply
Alex Scali says September 1, 2012

+100. Very good, Can i save talk in Skype on SD card ?

Reply
Rachita says November 15, 2012

This code is giving java.lang.runtime exception media recorder start failed!
pls help if you know the fix

Thanx

Reply
Mathew says April 17, 2013

thank you…was useful !!

Reply
bryan says April 29, 2013

Hi. i tried the code above, however when i check the file directory for the saved audio file, i could not find it and it keep saying that the file is empty.

Please help.

Reply
Sarah says September 12, 2013

the stop button says “Force close…” y is that? how to solve this?

Reply
Sanjay says October 12, 2013

great…..

Reply
Sanjay says October 12, 2013

Tell me how to get file of recorded sound?

Reply
sanchayan says January 1, 2015

i want to add timer to calculate recording time. how to do this

Reply
Add Your Reply