O'Reilly logo

Java for Android, Second Edition by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 43

Making Videos

The easiest way to provide video-making capability in your application is to use a built-in intent to activate an existing activity. However, if you need more than what the default application can provide, you need to get your hands dirty and work with the API directly.

This chapter shows how to use both methods for making videos.

Using the Built-in Intent

If you choose to use the default Camera application for making video, you can activate the application with these three lines of code.

int requestCode = ...;
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, requestCode);

Basically, you need to create an Intent object by passing MediaStore.ACTION_VIDEO_CAPTURE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required