This article is an example of how Android calls the phone's camera function. Share to everyone for your reference. Specifically as follows:
First, main.xml layout file:
Second, the core code:
Package com.ljq.test;
Import Java.io.ByteArrayOutputStream;
Import Java.io.File;
Import android.app.Activity;
Import android.content.Intent;
Import Android.graphics.Bitmap;
Import Android.net.Uri;
I
. getPackageManager (). hasSystemFeature (PackageManager. FEATURE_CAMERA )){
// This device has a camera
Return true;
} Else {
// No camera on this device
Return false;
}
}
Android devices can have multiple Camera, such as Camera on the back of photography and
1. Set the camera direction
2. Open the thread and preview thread
3. Set Parameters
4. Camera peripheral buttons
5. Auto Focus and touch focus
6. Take a photo
7. Face Detection
8. Location Management
9. rotation Management
10. Zoom
11. Video
The architecture of camera is a typical C/S architecture. The client side and user behavior are the functions of applica
Android watermark camera and android watermark
The watermark camera implemented in this article is similar to the watermark camera function in the QQ space. Because I have read a demo to implement a simple watermark camera functio
We first realize the circular effect of the photo button ha, Android development, of course, you can find art designers to design pictures, and then directly brought in, but we can write their own code to achieve this effect ha, the most commonly used is the layout-list to achieve the superposition of pictures, we this layout named BTN _take_photo.xml, this is a custom drawable file, so according to the spec, we're going to put it in the Drawable fold
This article implements the Android system camera call to take photos
The layout of the project is fairly simple, with only one button:
First open the list file under the Packages\apps\camera folder and find the following code:
The relevant code is as follows:
public class Mainactivity extends activity {
@Override
protected vo
This article implements the Android system camera call to take photos
The layout of the project is fairly simple, with only one button:
First open the list file under the Packages\apps\camera folder and find the following code:
The relevant code is as follows:
public class Mainactivity extends activity {
@Override
protected v
. Parameters params = mCamera. getParameters ();// Set the focus modeParams. setFocusMode (Camera. Parameters. FOCUS_MODE_AUTO );// Set Camera parametersMCamera. setParameters (params );
This method is effective for most camera features, and most parameters can be changed at any time. changes to parameters are usually immediately displayed in the app's
Refer to Android camera call, http://blog.csdn.net/yanzi1225627/article/details/33028041/, thank youHow to call the camera do not repeat, the following is the JS call camera code:Java:1**2* Created by Administrator on 2016/6/24 0024.3*/4 Public classQrcodehtmlactivityextendsActivity {5 /**6 * Web page7 */8
The following tool class is used to simplify and optimize the common Photo Taking methods to achieve no preview.
Import java. io. file; import java. io. fileOutputStream; import java. io. IOException; import java. text. simpleDateFormat; import java. util. date; import android. annotation. suppressLint; import android. annotation. targetApi; import android. app.
In Android, there are two ways to use a camera to take photos, one is to call the system's own camera, the other is to write a camera interface.
We want to add the following permissions:
1. Call System Camera
The main steps to invoke the
Android. Graphics. camera can perform complex operations on images, such as rotating and blooming, and skews images with matrix.
In my summary, some differences between camera and matrix are as follows:
The rotate () method of camera is to specify the Rotation Angle of a dimension.
The rotate () method of matrix ac
This camera is not a camera in Android. the camera in the graphics package can be understood as the angle of view in the 2D graphics system, or the camera location. Based on the perspective principle, we can implement some simple 3D effects.
You can refer to the rotate3danim
Android cameraSeries Development (III): Taking photos through cameraapi
Author: Rain csdn blog: http://blog.csdn.net/gobitan/
Overview
There are two ways to use camera: using an existing app through intent and building your own app through camera. The intent method has been introduced in Series 1 of development. This article describes how to take photos through c
The new camera API, also known as CAMERA2, was introduced in Android 5.0. In general, we use the old Android camera API, even though in Android studio always hints are obsolete, but as long as it is available, there is no need to write two sets of code separately in order to
For reference only
Source: Reprinted
This article is exerpted fromChapter 10: Accessing Android hardwareOf the wrox bookProfessional Android Application Development by Reto MeierAnd is reused by permission of the publisher. This may not be reused without publisher permission
Using the camera
The popularity of digital cameras (particle ly within phone handsets) h
Android Camera + SurfaceView for custom photos and androidsurfaceview
Force a horizontal screen on the Activity to ensure that the preview direction is correct. Use OrientationEventListener to listen to the device direction. when determining whether a portrait is taken, rotate the photo and save it. This ensures that the preview image is in the same direction as the saved image.
Running effect:
Code:
Test
My understanding of Android camera will be written down one after another to gradually improve the camera network in the brain.
1. Two independent processes of Android camera
Android camer
);Rotation. setfillafter (true );Rotation. setinterpolator (New accelerateinterpolator ());// Rotation. setanimationlistener (New displaynextview (position ));
IMG. startanimation (rotation );}}
Rotate3danimation is an animation class, and it is also very simple:
First:
Package com. example. OpenGL. animation;
Import Android. View. animation. animation;Import Android. View. animation. transfor
Android Camera video demo, androidcameraGoogle launched the Camera2 class in Android 5.0 to replace Camera. However, Camera2 requires the minimum android sdk version to be minSdkVersion = 21 (5.0 system), so Camera2 cannot completely replace
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.