1. Sometimes the pictures taken are smaller than the actual ones
This may be related to the version.
But it's okay if it's over 2.0.
In 1.6, even if you use HW. Camera. maxhorizontalpixels and HW. Camera. maxverticalpixels.
Will get 1/4 of the original size
Intent imagecaptureintent = new intent (mediastore. action_image_capture );
File out = new file (environment. getexternalstoragedirectory (), "camera.jpg ");
Uri uri = URI. fromfile (out );
Imagec
I use the MediaStore. ACTION_VIDEO_CAPTURE intent class to capture the video, the video stored in default location (gallery), I want to store the video in specific location with specific name.I use MediaStore. EXTRA_MEDIA_TITLE and MediaStore. EXTRA_MEDIA_OUTPUT but I don't get the video at correct location, at least I need the path of recorded video.Solution 1:T
Music Resource Management and playback on the Android platform, and android Resource Management
The Android platform is based on the Linux and Open Mobile Alliance (OHA) systems. After innovative R D by China Mobile, it has designed a novel and unique user operation interface, enhancing browser capabilities and WAP compatibility, optimized many well-known engines in the multimedia field such as OpenCORE and WebKit in the browser field, and added Advanced platform middleware including games, wid
by the number to be called and uses the Uri as the data of the intent object.
Photograph
To start the camera to take a photo using Intent, we need to set the action value of the intent objectMediaStore.ACTION_IMAGE_CAPTURE. Then we use the keyMediaStore.EXTRA_OUTPUTSet the output path of the image, and callstartActivityForResult()Method to start the camera application and rewrite ouronActivityResult()In this way, you can learn that the photo is complete.
The sample code is as follows:
// Indica
Android platform based on the Linux and Open Mobile Alliance (OHA) system, through the Chinese Mobile Innovation Research and development, designed to have a new unique user interface, enhanced browser capabilities and WAP compatibility, optimize the multimedia field of Opencore, The browser field of WebKit and many other industry-renowned engines, including games, widgets, Java me and other advanced platform middleware. This paper mainly introduces how to use the multimedia programming environm
. injustdecodebounds = false; int be = (INT) (options. outheight/(float) 200); If (be
Get the video thumbnail:
/**
* Obtain the specified video thumbnail Based on the video URI address.
* @ Param cr
* @ Param URI indicates the URI of the local video.
* @ Return returns bitmap data.
*/
Public static bitmap getvideothumbnail (contentresolver Cr, Uri URI ){Java code
Bitmap bitmap = NULL;
Bitmapfactory. Options = new bitmapfactory. Options ();
Options. indither = false;
Options. inpreferr
http://www.eoeandroid.com/forum.php?mod=viewthreadtid=98713==========================================================Mediascanner and music information scanning = = android system after the SD card is inserted, the Mediascanner service will automatically scan the file resources on SD in the background. Add the music media information on the SD to the Mediastore database. The program can read the corresponding media information directly from the
Set ringtones for Android development and ringtones for android Development
First, we will introduce the supported ringtone formats in Android. There are the following types:
64Hz Midi, AAC, AAC +, AMR, WAV, MP3, Real Audio, WMA, OGG, and other formats.
It is easy to set the audio file as a ringtone, just a few steps:
1) obtain the Uri of the system audio file
Uri uri = MediaStore. Audio. Media.GetContentUriForPath(File. getAbsolutePath (); // obtain
Android obtains multiple recent photos from the album (obtains the photos stored by the camera ),
Reprinted please indicate the source: http://blog.csdn.net/android_ls/article/details/39928519
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
Cropping photos for Android Development
1. Select a photo from the album for Cropping
Select a photo from the album and crop it:
/*** Select a photo from the album for cropping */private void cropFromGallery () {// TODO Auto-generated method stub Intent intent = new Intent (); intent. setAction (Intent. ACTION_PICK); // Pick an item from the data intent. setType (image/*); // select intent from all images. putExtra (crop, true); // It is set to crop intent. putExtra (aspectX, 1); // intent fo
First, let's talk about the android multimedia database. MediaStore is a multimedia database provided by the android system. Multimedia Information in android can be extracted from this class. This MediaStore includes all the information of the multimedia database, including audio, video, and image. android encapsulates all the multimedia database interfaces, and all databases do not need to be created by t
[Android] 20.3 camera and video recording, androidprop 3
Category: C #, Android, VS2015;
Date created: 1. Introduction
The Camera provided by Android has two typical versions: one is provided before Android 5.0, called Camera; the other is provided from Android 5.0, called Camera2.
Here, we only demonstrate how to use the system Camera program to take photos. Ii. Basic concepts of Camera
There are two ways to achieve the Camera and Camera functions using Camera:
First, you can directly use Inten
~ I also posted out for reference.public static list. Getcontentresolver(). Query(Mediastore. Audio. Media. EXTERNAL_content_uri, NULL, NULL, NULL, or NULL);ArrayList Mp3infos = new ArrayList ();for (int i =0; i Cursor. MoveToNext();hashmap;Long id = cursor. Getlong(cursor. Getcolumnindex(Mediastore. Audio. Media. _id));//Music IDString title = cursor. getString(cursor. Getcolumnindex(
How to determine files? You can use Cursor to traverse the database and compare the value of the INTERNAL_CONTENT_URI field. This is a Uri, which stores the complete path of the multimedia file on the Android mobile phone SD card.
[Java]
Copy codeThe Code is as follows: Uri originalUri = MediaStore. Images. Media. EXTERNAL_CONTENT_URI;
// If it is a Video, it is MediaStore. Video. Media. EXTERNAL_CONTENT_UR
When the Android system is started, it will automatically detect the SD card files and collect music files to generate a database file. We only need to access the information in the database table to obtain the required File Code as follows:
Obtain the cursor object to access the media resources in the cursor.
If (cursor. moveToFirst () {do {String title = cursor. getString (cursor. getColumnIndex (MediaStore. audio. media. TITLE); String singer = cu
playing// (For example, using an Intent)}}}
Public class MusicIntentReceiver implements android. content. BroadcastReceiver {@ OverridePublic void onReceive (Context ctx, Intent intent ){If (intent. getAction (). equals (Android. media. AudioManager. ACTION_AUDIO_BECOMING_NOISY )){// Notify your service to stop playing// (For example, using an Intent)}}} Get media from a ContentResolver
Another useful feature of the media play application is to retrieve the music stored on the device by the use
contentproviders provided by android:
Android manages several Uris of ContentProvider for contacts:
ContactsContract. Contacts. CONTENT_URI: Uri used to manage ContactsContactsContract. CommonDataKinds. Phone. CONTENT_URI: Uri used to manage the contact's Phone numberContactsContract. CommonDataKinds. Email. CONTENT_URI: Uri used to manage contact emails
Android provides several Uris for multimedia management ContentProvider:
MediaStore. Audio. Media
Recently I made an android music player. I personally felt that the most difficult part was "playing back" and "playing list", but I finally found the implementation method. Different people may implement different methods. Here I will share some of my implementation methods for the "playlist" module. "playing back" will be introduced in the next blog, I hope you can share some of your ideas.
Android uses ContentProvider to support data sharing between different applications. To facilitate opera
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.