views:

278

answers:

2

i want to develop an application on android phone regarding voice recorder.i have to record a sound for about 30 seconds and then stop and save the recorded sound in gallery.can anyone post the code if you have please?

+1  A: 

So you want someone to actually post the whole code of the application you want to code?

Here it is, I guess.

Lo'oris
+3  A: 

There is an example of how to do audio capture using MediaRecorder in the Android Developer Documentation.

I would recommend saving the files on the SD Card and then have your gallery code check the SD card to see which files to display. You can get the directory of the SD Card using the Environment.getExternalStorageDirectory() method. It would be best to save your files in a subdirectory of the SD Card root directory.

Make sure you give your applications the Permissions it will need. At the very least it will need RECORD_AUDIO and WRITE_EXTERNAL_STORAGE.

Dave Webb