take Sound Recorder - Android android.media

Android examples for android.media:Sound

Description

take Sound Recorder

Demo Code

import android.app.Activity;
import android.content.Intent;

public class Main{

  public static final int REQUEST_CODE_TAKE_PHOTO = 0xF1;
    public static final int RESULT_CAPTURE_RECORDER_SOUND = REQUEST_CODE_TAKE_PHOTO + 2;

    public static void takeSoundRecorder(Activity activity) {
        Intent intent = takeSoundRecorderIntent();
        activity.startActivityForResult(intent,
                RESULT_CAPTURE_RECORDER_SOUND);
    }//from w  w  w. ja v a 2  s .  co  m
    private static Intent takeSoundRecorderIntent() {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        intent.setType("audio/amr");
        return intent;
    }

}

Related Tutorials