Android simple way to call pictures, video, audio, recording and photography _android

Source: Internet
Author: User
Tags sqlite database

This article illustrates a simple way to call pictures, video, audio, recording, and photographing in Android. Share to everyone for your reference, specific as follows:

Select the logo returned by the picture Requestcode Intent innerintent = new Intent (intent.action_get_content); "Android.intent.action.GET_CONTENT" Innerintent.settype (ContentType);
View type String image_unspecified = "image/*";
Intent wrapperintent = Intent.createchooser (innerintent, NULL);
(activity)-Startactivityforresult (Wrapperintent, Requestcode);
Video Intent innerintent = new Intent (intent.action_get_content); Innerintent.settype (ContentType);
String video_unspecified = "video/*";
Intent wrapperintent = Intent.createchooser (innerintent, NULL);
(activity)-Startactivityforresult (Wrapperintent, Requestcode);
Add Audio Intent innerintent = new Intent (intent.action_get_content); Innerintent.settype (ContentType);
String video_unspecified = "video/*";
Intent wrapperintent = Intent.createchooser (innerintent, NULL);
(activity)-Startactivityforresult (Wrapperintent, Requestcode);
Recording Intent Intent = new Intent (intent.action_get_content); Intent.settype (CONTENTTYPE.AUDIO_AMR); StrinG AUDIO_AMR = "audio/amr";
Intent.setclassname ("Com.android.soundrecorder", "Com.android.soundrecorder.SoundRecorder");
(activity)-Startactivityforresult (Intent, Requestcode); Shooting video int durationlimit = Getvideocapturedurationlimit ();
Systemproperties.getint ("Ro.media.enc.lprof.duration", 60);
Intent Intent = new Intent (mediastore.action_video_capture);
Intent.putextra (mediastore.extra_video_quality, 0);
Intent.putextra (Mediastore.extra_size_limit, SizeLimit);
Intent.putextra (Mediastore.extra_duration_limit, durationlimit);
Startactivityforresult (Intent, request_code_take_video); Photo Request_code_take_picture for the returned identification Intent Intent = new Intent (mediastore.action_image_capture);
"Android.media.action.IMAGE_CAPTURE"; Intent.putextra (Mediastore.extra_output, Mms.ScrapSpace.CONTENT_URI);
Output,uri.parse ("Content://mms/scrapspace");

 Startactivityforresult (Intent, request_code_take_picture);

For more information on Android-related content readers can view the site: "Android Multimedia how-to Summary (audio, video, recording, etc.)", "Android Development introduction and Advanced Course", "Android view summary of the tips", " The activity Operation skill summary of Android programming, "Android operation SQLite database Skill Summary", "Android operation JSON format Data technique summary", "Android database Operation skill Summary", "Android File Operation skill Summary "," Android programming development of SD card operation method Summary "," Android Resource Operation skills Summary "and" Android Control usage Summary "

I hope this article will help you with the Android program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.