Android Dev has a simple code that describes how to launch the camcorder using intent.
Now itโs good if you just want to start the camera and wait for the user to press the red โRECโ button.
But I want to call the camcorder through Intent and tell her to start recording programmatically.
How to do it? Am I passing some kind of start () method on an Intent command?
(if this cannot be done, please show me a simple bit of code that can be configured to record video automatically - I searched the Internet, but all codes regarding this problem do not work)
private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 100;
private Uri fileUri;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
source
share