Android development skills-the Camera feature of Camera
This article summarizes how to use Camera to take photos of development projects. Camera2 is introduced in api level 21 (5.0.1), while Camera to 6.0 is still usable. Therefore, camera2 is not considered yet.
Brief introductionAndroid SDK supports built-in cameras for Android devices. Support for multiple cameras starting from Android2.3 (primarily front-facing and rear-facing cameras). Photos and videos can be photographed.Issues to consider
Whether the camera is supported
Take a quick photo or a custom photo
Storage issues
Main APIs involved in cameras
Intent heard the action to
1. First, call the takepicture method of camera. Java (frameworks \ base \ core \ Java \ Android \ hardware) in the framework layer.
2. The android_hardware_camera.cpp (frameworks \ base \ core \ JNI) android_hardware_camera_takepicture method on the JNI layer is called. The camera object is obtained through get_native_camera.
3. The preceding
Enable front camera and rear camera for AndroidPreface:My Android device is the original N70 dual tablet. This tablet does not have a rear camera and only has a front camera. When I install someProgramThen the program exits. After thinking about it, I found that the general
This article illustrates the solution to the black screen of the Android custom camera camera. Share to everyone for your reference, specific as follows:
For some phones, like HTC, when customizing camera, call Camera.parameters's parameters.setpreviewsize (width, height) method when the width and height are odd, Ther
Camera Main parameters:1, MCLK 24MHz;2, PCLK 48~52mhz~;3, Voltage 1.8V (1.5V), 2.8V;4, SCL (IIC clock) 100KHz or 400KHz.Download: Common camera Spec book (individual with Android driver) : bf3703 30W, gc0308 30W, ov7670, gt2005 200W, gt2015 200W, NT99250 200W, S5k5ba 200W, S5k4ba First, the camera driverLet's take GT20
In order to prevent candid camera, the industry has unwritten rules, mobile phone companies in doing camera, click on the camera and video button, must have a beep. As a result, Google is also very user-friendly to play the function of the sound of the camera, placed in the cameraservice, to prevent developers can not
Usually we do camera operations, such as scanning two-dimensional code needs to determine whether there is a rear-mounted camera (rear camera), such as the Nexus 71 generation has no rear-mounted camera, so in the attempt to use, we need to make a judgment for some hints or processing.
The following code is a series o
caveats:1, Textureview is the increase after Android 4.0, the lower version number of this class. Textureview must work in an environment where hardware acceleration is enabled. This is also the setting of the activity in the configuration file: Android:hardwareaccelerated= "True" the default property is True, so no more writing. But if you write false, you can see Onsurfacetextureavailable () This callback will not come in. Textureview don't have su
To prevent videotaping, the industry has unwritten rules, mobile phone companies in doing camera, click on the camera and video button, must have a beep. As a result, Google is also very user-friendly to play the function of the sound of the camera, placed in the cameraservice, to prevent developers can not develop the camera
caveats:1, Textureview is the Android 4.0 after the addition of the lower version of this class. Textureview must work in an environment where hardware acceleration is enabled, in the settings of the activity in the configuration file: Android:hardwareaccelerated= "True" is the default property, so no more writing is required. But if you write false, you can see Onsurfacetextureavailable () This callback will not come in, Textureview no surfacetextur
There are unwritten rules in the industry that phone companies must have a prompt when they click the photo and video keys for camera. Therefore, google also put the function of playing the photo sound in the cameraService to prevent developers from developing a non-audible camera. Therefore, as long as the camera function is called, it will surely sound, this is
There are unwritten rules in the industry that phone companies must have a prompt when they click the photo and video keys for camera. Therefore, google also put the function of playing the photo sound in the cameraService to prevent developers from developing a non-audible camera. Therefore, as long as the camera function is called, it will surely sound, this is
In jb2, take a photo/video in camera, and click the thumbnail in the lower right corner/slide to the left to view the image/video, after you click "delete" menu to delete all images/videos, the camera preview is displayed only at about 1/4 on the left of the screen. After sliding to the right, the camera preview interface is displayed. How to automatically return
for the beginning of row y for the Y plane and row c for the U and V planes: yStride = (int) ceil (width/16.0) * 16; uvStride = (int) ceil (yStride/2)/16.0) * 16; ySize = yStride * height; uvSize = uvStride * height/2; yRowIndex = yStride * y; uRowIndex = ySize + uvSize + uvStride * c; vRowIndex = ySize + uvStride * c; size = ySize + uvSize * 2; www. 2ct O.com strongly recommends NV21 and YV21 formats, which are NV21 by default, that is, YUV420SP. Therefore, BitmapFactory resolution cannot be s
In the past two days, after programming the android camera module and setting various parameters, we found that during previewing, the photos were reversed, rather than up or down, but 90 °. My mobile phone is Huawei u9200 and I used android4.0.3. Later I saw fuse (90), and then the preview was normal. However, the photos are still skewed when they are opened on the computer. Tilted 90 °, and then added thi
1.In the oncreate method:
1.1Call the getpreferredcameraid () method. In this method, the combopreferences object is added, which is used to manageProgramThe configuration file generated in the package name. After obtaining this object, some configurations are initialized. Then read the camera ID mcameraid from the configuration file and call util. the getcamerafacingintentextras (this) method is obtained through "
This example describes the stopwatch timer implemented by Android. Share to everyone for your reference, specific as follows:
Package com.liu.time;
Import Java.util.Timer;
Import Java.util.TimerTask;
Import android.app.Activity;
Import Android.app.AlertDialog;
Import Android.content.Context;
Import Android.content.DialogInterface;
Import android.content.SharedPreferences;
Import Android.os.Bundle;
Imp
Android framework camera review-Relationship between Camera CameraClient ICamera (1)-cl and c-) Where does mCamera go?
Status_t Camera: connectLegacy (int cameraId, int halVersion, const String16 clientPackageName, {sp
C = new Camera (cameraId); s
Int clientUid, sp
A
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.