mediastore

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

Video Playback file Switching Based on videoview

. oncreate (icicle );Setcontentview (R. layout. movie_view );Mvideoview = (videoview) findviewbyid (R. Id. surface_view );Uri uri = getintent (). getdata ();Mcurrent = getintent (). getintextra ("START", 0 );Makecursor ();Mvideoview. setonerrorlistener (this );Mvideoview. setoncompletionlistener (this );Mvideoview. setonpreparedlistener (this );Mvideoview. setvideouri (URI ); Mmediacontroller = new mediacontroller (this, false );Mmediacontroller. setprevnextlisteners (mnextlistener, mprevlistene

Android gets multiple recent photos from the album (get the photos stored by the camera)

Android gets multiple recent photos from the album (get the photos stored by the camera) When you are working on a company project, you need to customize the grid view of the displayed photos to display the first 20 photos that you have taken with a recent camera. I checked the API provided by the system and did not find the path constant pointing directly to storing photos after taking photos with a camera. If anyone knows, please let me know. Thank you! The following is an example of my stupi

Call camera intent

When you call a camera, you sometimes need to return an image. Sometimes, you do not need to return an image. Case 1,Call the camera in the app,Save the image to the specified directory., Returned to the app: PublicVoidStartintentforresult (){ Intent intent =NewIntent (mediastore. action_image_capture ); Intent. putextra (mediastore. extra_output, Uri. fromfile (mfile )); Startactivityfo

The android system obtains the URI using the absolute path of the image.

In a recent project, you need to find the URI of the image through the absolute path of the image, delete the image, and summarize the method for obtaining the URI. Android 4.1.3 systems are available. 1. Retrieve all image paths, traverse and compare to find the desired path, and retrieve the URI, which is less efficient. The MediaStore. MediaColumns. DATA Field stores the absolute path of the image, At last, mImageUri obtains the image URI. 1 Uri m

Pro. Android media-process large images

Call the camera program and add it to intent.Android. provider. mediastore. extra_outputParameter to set the image storage location. As follows: Java code String imagefilepath = environment. getexternalstoragedirectory (). getabsolutepath () + "/Myfavoritepicture.jpg "; File imagefile = new file (imagefilepath ); Uri imagefileuri = URI. fromfile (imagefile ); // URI imagefileuri = URI. parse ("file: // sdcard/myfavoritepicture.jpg "); Inte

Android practice simple tutorial-28th gun (Uri to String type instance), androiduri

Android practice simple tutorial-28th gun (Uri to String type instance), androiduri After reading the previous article, we can easily obtain the uri of the selected image. So how can we convert the obtained uri to a String address? Next we will study it through examples. The layout file is the same as the previous article (article 27), so we will not list it any more. Let's look at MainActivity. java: Package com. example. userphoto; import java. io. file; import android. app. activity; import

Use Android built-in camera for photo taking

Main Program: Public class androcamera extends activity { Private Static final int image_capture = 0; Private button startbtn; Private URI imageuri; Private imageview; /** Called when the activity is first created.* Sets the content and gets the references* The basic widgets on the screen like* {@ Code button} or {@ link imageview}*/@ OverridePublic void oncreate (bundle savedinstancestate ){Super. oncreate (savedinstancestate );Setcontentview (R. layout. Main );Imageview = (imageview) fin

Get sdcard image thumbnails

String [] projection = {mediastore. Images. Media. size, Mediastore. Images. Media. display_name }; Uri uri = mediastore. Images. thumbnails. getcontenturi ("external "); Cursor c = thumbnails. queryminithumbnails (getcontentresolver (), Uri, The code in the second line indicates the URI of the path for obtaining the sdcard. Uri uri =

Call the built-in camera Application

Mainactivity code: Package COM. chen. test6; import Java. io. file; import Java. text. simpledateformat; import Java. util. date; import android. app. activity; import android. content. intent; import android.net. uri; import android. OS. bundle; import android. OS. environment; import android. provider. mediastore; import android. util. log; import android. view. view; import android. view. view. onclicklistener; import android. widget. button; impor

Use Android Handler asynchronous message processing mechanism to create a powerful image loading class

update the UI interface. After talking about this, you may think that the cloud is in the fog. Let's look at the actual example below.2. Implementation of the Image Library Function This program first scans all the folders containing images on the mobile phone, and finally selects the most picture folder, and displays the images in the folder using the GridView.1. layout File The layout file is quite simple, just like a GridView 2. MainActivity Package com. example. zhy_han

Study on Gallery in Android source code (1)

. Speaking of this, I will mention the method of analyzing the source code. If you have a little knowledge of the Android source code, you should know that the Android source code is very huge, therefore, the starting point of the analysis program can be roughly divided into two types: the first is to analyze the source code according to the operating procedures-applicable to programs with clear interface jump; the second is to analyze the program running logic based on the printed Log informati

Android4.4 ContentResolver does not update the ContentResolver after the image is invalid and the image is added to the image library is deleted.

: Uri mImageUri = MediaStore. images. media. EXTERNAL_CONTENT_URI; Log. I ("yanguoqi", "mImageUri =" + mImageUri. getPath (); ContentResolver mContentResolver = MainActivity. this. getContentResolver (); // only query jpeg image Cursor mCursor = mContentResolver. query (mImageUri, null, MediaStore. images. media. MIME_TYPE + "=? ", New String [] {" image/jpeg "}, Media

Common android actions

. GET_CONTENT" Intent. setType (contentType); // view type String 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,

Set ringtones for Android

Testing Machine: Xiaomi 2.3.5There are actually a few lines of code. Here we will simply record the learning process.When the Android system starts, It scans the system and SD card for media files, stores them in the sqlite database, and provides external services in the form of contentProvider.Path:/data/com. android. providers. media/databases/XXX...We can see two db files, one in the system and the other in the SD card.Use SQLite Expert to open internal. db, as shown in the following section:

Read external from android media library

1. android manages multimedia files (audio, video, and image. In the/data/com. android. providers. in media, find the database file and open external. for more information about the db file, see the ing between the file path (_ data) and the Uri ID (_ id) in the media table. Ii. URI and file conversion 1. obtain the file path [java] string myImageUrl = "content: // media/external/images/media/***" from URI; Uri uri Uri = URI. parse (myImageUrl); String [] proj = {

Call the system interface on the android platform

. createChooser (it, "Choose Email Client ")); Intent it = new 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, "The email body text "); It. putExtra (Intent. EXTRA_SUBJECT, "The email subject text "); It. setType ("message/rfc822 "); StartActivity (Intent. createChooser (it, "Choose Email Client ")); Intent it = new Intent (Intent. A

Android Image Upload (Avatar cropping + original image ),

listener class private OnClickListener itemsOnClick = new OnClickListener () {@ Overridepublic void onClick (View v) {menuWindow for the pop-up window. dismiss (); switch (v. getId () {// photograph case R. id. takePhotoBtn: Intent takeIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE); // The following sentence specifies the path takeIntent for storing the photo after the camera is taken. putExtra (MediaStor

Android WebView upload file support full resolution _android

I.getauthority ()); /** * @param uri the URI to check. * @return Whether The Uri authority is mediaprovider. */public static Boolean ismediadocument (Uri uri) {return ' com.android.providers.media.documents '. Equals (Uri.getaut Hority ()); }/** * Get the value of the ' data column ' for this Uri. This is useful to * Mediastore Uris, and other file-based contentproviders. * * @param context. * @param uri the URI to query. * @param

Android Image Rendering (6)-obtaining local images or taking pictures

Obtain image resources from the SD card or take a new image. Post Code first Get image: Note: You can specify the address to save the image when taking the photo. [Java]CharSequence [] items = {"album", "camera "};New AlertDialog. Builder (this). SetTitle ("select image source "). SetItems (items, new OnClickListener (){Public void onClick (DialogInterface dialog, int which ){If (which = SELECT_PICTURE ){Intent intent = new Intent (Intent. ACTION_GET_CONTENT );Intent. addCategory (Intent. CATEGO

Android starts to take a photo/video in the program or select an image/video, and create a thumbnail to save it.

Sometimes we need to select an image as the Avatar or upload it to the album. In this case, we can choose to start the camera or choose from the image library. First, let's see how to start the camera and take the photo. The following code starts the camera and returns the photo: Public void capturepicture () {// start and save the photo to the temporary file intent = new intent (); intent. setaction (mediastore. action_image_capture); intent. putext

Related Keywords:
Total Pages: 15 1 .... 3 4 5 6 7 .... 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.