Android calls the System camera three steps, Android calls three steps
Step 1:
<Uses-permissionandroid: name = "android. permission. WRITE_EXTERNAL_STORAGE"/>
<Uses-permissionandroid: name = "android. permission. MOUNT_UNMOUNT_FILESYSTEMS"/>
Step 2:
Intent intent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE );
StartActivityForResult (intent, 1 );
Step 3:
Protected void onActivityResult (int requestCode, int resultCode, Intent data ){
// TODO Auto-generated method stub
Super. onActivityResult (requestCode, resultCode, data );
If (resultCode = NewsActivity. RESULT_ OK ){
String sdStatus = Environment. getExternalStorageState ();
If (! SdStatus. equals (Environment. MEDIA_MOUNTED) {// check whether sd is available
Log. I ("TestFile ",
"SD card is not avaiable/writeable right now .");
Return;
}
String name = new DateFormat (). format ("yyyyMMdd_hhmmss", Calendar. getInstance (Locale. CHINA) + ". jpg ";
Toast. makeText (this, name, Toast. LENGTH_LONG). show ();
Bundle bundle = data. getExtras ();
Bitmap bitmap = (Bitmap) bundle. get ("data"); // obtain the data returned by the camera and convert it to the Bitmap image format.
FileOutputStream B = null;
//??????????????????????????????? Why can't I save it directly in the system album ????????????
File file = new File ("/sdcard/myImage /");
File. mkdirs (); // create a folder
String fileName = "/sdcard/myImage/" + name;
Try {
B = new FileOutputStream (fileName );
Bitmap. compress (Bitmap. CompressFormat. JPEG, 100, B); // write data to a file
} Catch (FileNotFoundException e ){
E. printStackTrace ();
} Finally {
Try {
B. flush ();
B. close ();
} Catch (IOException e ){
E. printStackTrace ();
}
}
ImageView iv = (ImageView) findViewById (R. id. news_ImageView_image );
Iv. setImageBitmap (bitmap );
}
}
What kind of learning English software is available for Android?
Other learning software can also be downloaded from the android network as Kingsoft's word master or has three-way synchronization: client, Web, and mobile phone (including Android). Learn English Lenovo memory anytime, anywhere:
How can I combine multiple videos into one video captured by a camera?
I don't know what formats the landlord uses a digital camera and video. Three-step policy is recommended: 1. Entry-level entry-movie maker. Generally, a video editing software is provided in windows, which is simple and easy to use. 2. Improvement and Development-sound and shadow (if you remember correctly, there should be an image 11 now ). There are more special effects than movie maker and more functions. 3. Professional entry-Premiere Pro 2.0. It should be regarded as high-end, more professional and more complex than the above two. There are a lot of places for research, and it is really interesting to play. If you are a video cutting and editing enthusiast, we suggest following the three-step policy above"