mediastore

Alibabacloud.com offers a wide variety of articles about mediastore, easily find your mediastore information here online.

Examples of Android photo taking, video recording, and Recording Code

Package com. Cons. DCG. Collect;Import java. Io. file;Import java. Text. simpledateformat;Import java. util. arraylist;Import java. util. date;Import java. util. hashmap;Import java. util. List;Import Android. App. activity;Import Android. App. notification;Import Android. App. icationicationmanager;Import Android. App. pendingintent;Import Android. App. progressdialog;Import Android. content. intent;Import Android. database. cursor;Import android.net. Uri;Import Android. OS. asynctask;Import An

Intent. Action for Android Development

IMAGE_UNSPECIFIED = "image /*"; Intent wrapperIntent = Intent. createChooser (intent, null ); (Activity) context). startActivityForResult (wrapperIntent, requestCode ); // Add audio Intent intent = new Intent (Intent. ACTION_GET_CONTENT ); Intent. setType (contentType); // String VIDEO_UNSPECIFIED = "video /*"; Intent wrapperIntent = Intent. createChooser (intent, null ); (Activity) context). startActivityForResult (wrapperIntent, requestCode ); // Video shooting Int durationLimit = getVideoCa

Two audio recording methods for Android

. io. FileOutputStream;Import java. io. IOException;Import android. app. Activity;Import android. content. ContentValues;Import android. content. Intent;Import android. hardware. Camera. AutoFocusCallback;Import android. media. AudioFormat;Import android. media. AudioManager;Import android. media. AudioRecord;Import android. media. AudioTrack;Import android. media. MediaPlayer;Import android. media. MediaRecorder;Import android.net. Uri;Import android. OS. AsyncTask;Import android. OS. Bundle;Im

Intent. Action for Android Development

(intent, null ); (Activity) context). startActivityForResult (wrapperIntent, requestCode ); // Add audio Intent intent = new Intent (Intent. ACTION_GET_CONTENT ); Intent. setType (contentType); // String VIDEO_UNSPECIFIED = video /*; Intent wrapperIntent = Intent. createChooser (intent, null ); (Activity) context). startActivityForResult (wrapperIntent, requestCode ); // Video shooting Int durationLimit = getVideoCaptureDurationLimit (); // SystemProperties. getInt (ro. media. enc. lprof. dura

Analysis on Android video Development

(){Mrec. Stop ();Mrec. Release ();Processaudiofile (audiofile. getabsolutepath ());}Protected void processaudiofile(){Contentvalues values = new contentvalues (3 );Long Current = system. currenttimemillis ();Values. Put (mediastore. Audio. Media. title, "audio" + audiofile. getname ());Values. Put (mediastore. Audio. Media. date_added, (INT) (current/1000 ));Values. Put (

G-sensor series 1

(){Contentvalues values = new contentvalues (3 );Long Current = system. currenttimemillis ();Values. Put (mediastore. Audio. Media. title, "audio" + audiofile. getname ());Values. Put (mediastore. Audio. Media. date_added, (INT) (current/1000 ));Values. Put (mediastore. Audio. Media. mime_type, "audio/3GPP ");Values. Put (me

Android video recording (4)

MainActivity is as follows: Package C. c; import android. app. activity; import android. content. contentvalues; import android. content. intent; import android.net. uri; import android. OS. bundle; import android. provider. mediastore; import android. view. view; import android. view. view. onclicklistener; import android. widget. button; import android. widget. edittext;/*** demo Description: * 1. Use the System camera to take a video. * 2. Use the

Android content providers refresh the image and Arraylist sorting,

the one in the album is found. If the picture is deleted from the album, the image in the specified path is left in the cell phone, wasting memory !!! In short, I personally think the above method is a little pitfall. Delete images Private void DeleteImage (String imgPath) {ContentResolver resolver = context. getContentResolver (); Cursor cursor = MediaStore. images. media. query (resolver, MediaStore. ima

Photo Taking, multiple choice, preview, and deletion (photo removal) of android high imitation WeChat

(cursor.getColumnIndex(ImageColumns.DATA)));photos.add(photoModel);}} while (cursor.moveToPrevious());return photos;} (4) Take a photo and update the local photo in time Public void photo () {// Intent openCameraIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE); // startActivityForResult (openCameraIntent, TAKE_PICTURE); try {File dir = new File (Environment. getExternalStorageDirectory () + "/" + localTempImgDir); System. out. pri

Android multimedia-System camera

Android multimedia-System camera To take a photo with a system camera and return the photo, follow these steps:[1] Permission [2] Start the camera with intent Intent intent = new Intent (); intent. setAction (MediaStore. ACTION_IMAGE_CAPTURE); // implicitly start the System camera [3] set the image storage location and name File = new File (Environment. getExternalStorageDirectory (), System. currentTimeMillis () +. jpg); // create a new

Android video recording (3)

MainActivity: [java] package c. c; import android. app. activity; import android. content. contentValues; import android. content. intent; import android.net. uri; import android. OS. bundle; import android. provider. mediaStore; import android. view. view; import android. view. view. onClickListener; import android. widget. button; import android. widget. editText;/*** Demo Description: * 1. Use the System camera to take a video. * 2. Use the system

Android 4.4 kitkat and above, and the following method to obtain the path based on uri

-primary volumes} // DownloadsProvider else if (isDownloadsDocument (uri )) {final String id = DocumentsContract. getentid (uri); final Ur I contentUri = ContentUris. withAppendedId (Uri. parse ("content: // downloads/public_downloads"), Long. valueOf (id); return getDataColumn (context, contentUri, null, null);} // MediaProvider else if (isMediaDocument (uri) {final String docId = DocumentsContract. getentid (uri); final String [] split = docId. split (":"); final String type = split [0]; Uri c

Best practices for retrieving and cropping images from a camera (album), best practices for tailoring

obtain images. The first is camera shooting, and the second is to obtain images from a local album. 2. I created a folder on the SD card with two Uris. One is used to save the original image and the other is the saved cropped image. I have previously considered using the same Uri to save the image, but in practice I encountered a problem. If the image is not cropped after being taken, the next time I get the image from the SD card, it will be the big image saved by the photo, not only does the

Android system details: Getting thumbnails of images and videos

:[ Java] public static Bitmap getVideoThumbnail (ContentResolver cr, Uri uri) {Bitmap bitmap = null; BitmapFactory. options options = new BitmapFactory. options (); options. inDither = false; options. inPreferredConfig = Bitmap. config. ARGB_8888; Cursor cursor = cr. query (uri, new String [] {MediaStore. video. media. _ ID}, null); if (cursor = null | cursor. getCount () = 0) {return null;} cursor. MoveToFirst (); String videoId = cursor. getString

Android: How to obtain and compress local Images,

Android: How to obtain and compress local Images, During the two days of Project creation, the image upload function encountered two problems: how to obtain the path of the selected image, and how to compress the image, after checking some information and reading what others wrote, I finally made a hard move and recorded it here. First, to select images, we need to obtain all local images first. Android has encapsulated this intent for us. 1 Intent intent = new Intent (Intent. ACTION_PICK, null)

Android multimedia-learn to use the system camera in step 5

Android multimedia-learn to use the system camera in step 5 To take a photo with a system camera and return the photo, follow these steps:[1] Permission [2] Start the camera with intent Intent intent = new Intent (); intent. setAction (MediaStore. ACTION_IMAGE_CAPTURE); // implicitly start the System camera [3] set the image storage location and name File = new File (Environment. getExternalStorageDirectory (), System. currentTimeMillis (

Android ultra-high imitation WeChat image selector image loading,

(); initEvent ();}/*** uses ContentProvider to scan pictures on your mobile phone. This method scans images in the Child thread, the folder with the most jpg files */private vo Id getImages () {if (! Environment. getExternalStorageState (). equals (Environment. MEDIA_MOUNTED) {Toast. makeText (this, "No external storage", Toast. LENGTH_SHORT ). show (); return;} // display the progress bar mProgressDialog = ProgressDialog. show (this, null, "loading... "); new Thread (new Runnable () {@ Overrid

Android high imitation WeChat photo taking, multiple choice, preview, delete (remove photos) album Function

(cursor.getLong(cursor.getColumnIndex(ImageColumns.SIZE)) > 1024 * 10) {PhotoModel photoModel = new PhotoModel();photoModel.setOriginalPath(cursor.getString(cursor.getColumnIndex(ImageColumns.DATA)));photos.add(photoModel);}} while (cursor.moveToPrevious());return photos;} (4) Take a photo and update the local album in time Public void photo () {// Intent openCameraIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE); // startActivit

Android takes pictures and saves them (compressing and splitting images ),

state = Environment. getExternalStorageState (); if (Environment. MEDIA_MOUNTED.equals (state) {final Intent takePictureImIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE); ContentValues values = new ContentValues (); mPhotoUri = getContentResolver (). insert (MediaStore. images. media. EXTERNAL_CONTENT_URI, values); takePictureImIntent. putExtra (android. provider.

Android calls system programs

intent (intent. action_send ); String [] TOS = {"me@abc.com "}; String [] CCS = {"you@abc.com "}; It. putextra (intent. extra_email, TOS ); It. putextra (intent. extra_cc, CCS ); It. putextra (intent. extra_text, "theemail body text "); It. putextra (intent. extra_subject, "theemail subject text "); It. settype ("message/rfc822 "); Startactivity (intent. createchooser (IT, "Choose email client ")); Intent it = newintent (intent. action_send ); It. putextra (intent. extra_subject, "theemail sub

Related Keywords:
Total Pages: 15 1 .... 4 5 6 7 8 .... 15 Go to: Go

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.