Android under the camera has its own photo function, but as a developer, we need to know more deeply, how to use, and related principles, here I study in this area, write a lesson, for Bo friends reference.
The first: Call system comes with camera interface.
In this case, we can simply define a button on the layout file.
<button
android:onclick= "click"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "Photo"/>
In the activity, we just do it.
public void Click (View view) {
Intent Intent = new Intent ();
Intent.setaction ("Android.media.action.IMAGE_CAPTURE");
Intent.addcategory ("Android.intent.category.DEFAULT");
File File = new file ("/sdcard/apple/" +system.currenttimemillis () + ". jpg");
Uri uri = uri.fromfile (file);
Intent.putextra (Mediastore.extra_output, URI);
StartActivity (Intent);
}
In the simplest way, we can call the bear's washing that estimate.
Introduction to Android photography, video development of the relevant stuff