This article is mainly about: using the camera API to capture video data and save to a file, using Surfaceview, Textureview to preview the Camera data, take the NV21 data callback.Note: Requires permission:First, preview the Camera dataPeople who have done Android development generally know that there are two ways to d
This article translated from: http://developer.android.com/training/camera/videobasics.html
This article describes how to use the existing Camera application to take videos.
If your application only needs to integrate a small part of the video function, you can use the camera application provided on most Android device
one, what can Android camera do? 1. function
Take photos
Video recording
Viewfinder (scanning applications such as face recognition, business card recognition, barcode recognition)
2, according to the camera API to achieve their own photo program, a total of 7 steps
Created with Rapha?l 2.1.2
In the previous chapter, we completed the configuration of the Android Platform development environment, and also found a way to remove the OpenCV Manager API, then we start from scratch, the completion of a personal program, the implementation of the following functions:1. Identify the specified picture and draw the edge of the picture with a colored box2. Display a 3D model on the identified imageIt is not difficult to see that this is actually the
) {
super.handlemessage (msg);
SYSTEM.OUT.PRINTLN ("Update ...");
}
}
2. Create a new thread class that implements the Runnable interface, using a Boolean to control thread start and end Boolean islive = True as follows:[Java]View Plaincopy
Public class MyThread implements Runnable {
@Override
public Void Run () {
While (islive) {
try {
Thread.Sleep (+); Thread paused for 1 seconds, per millisecond
Message message = new Message ();
Message.what = 1;
Because the timer and the TimerTask class object can only be used once, if you want to dispatch the same task multiple times, you must instantiate it again.So, a Timerhelper class is encapsulated, and the test is available.1 Public Abstract classTimerhelper {2 3Private Timer Mtimer =NULL;4 5 Public voidStartLongDelayLongperiod)6 {7 stop ();8 9Mtimer =NewTimer ();TenMtimer.schedule (NewTimerTask ()
The time-Dispatch module was used in the recent project development, and Quartz.net was used in. NET development, and then downloaded the Java Quartz module, but it appeared in use java.lang.NoClassDefFoundError Anomalies, and later on-line search found alternative methodsUsing the system comes with the timer code as follows: Public class extends timertask{ @Override publicvoid run () { System.out.println ( New Date ());} }SimpleDateF
Place a timer with the specified detail date and time1 Public classMainactivity extends Activity {2 3 PrivateHandler Handler =NewHandler () {4 @Override5 Public voidhandlemessage (Message msg) {6 Switch(msg.what) {7 Case 1:8LOG.I ("====","performed a");9 //the code that needs to be executed is put hereTen Break; One } A } - }; - the @Override -
http://blog.csdn.net/freesonhp/article/details/25904047In peacetime when we program, often use the countdown to this function, many people do not know that Android has helped encapsulate a class, often write their own. Now that this class has been discovered, let's share it:The remaining time is constantly shown in a TextView code as follows:[Java]View Plaincopy
Private TextView Vertifyview;
private Countdowntimer
http://blog.csdn.net/jiangwei0910410003/article/details/52057543First, prefaceIn the video broadcast is generally two video data sources, one is the camera data, one is recorded desktop data, and generally beautiful girls live is from the camera data, game Live is recorded desktop data, then today to see the first Data source analysis, There are many scenes of using the
Application scenario: In the Android development process, it is sometimes necessary to call the phone's own device function, this article focuses on the camera function calls. Knowledge Points: Access to the phone's own device function (camera photo function), should ensure that the Androidmanifest.xml has been correctly stated in the use of the
These days I took part in a company-run programming marathon, and I intend to use the Android camera to do it. I've always thought that the Android API was bad, but it didn't say exactly what was bad or how it would be better to improve. Take this opportunity and I'll explain it now. I think Android's API for webcam is awful, if you haven't used it, take a moment
Android Camera Samsung BUG:The recent use of the camera feature in Android projects, other models of mobile phones have been successful, but only in Samsung's camera encountered a bug.The bug is reflected as follows:(1) Image data may not be returned after the
Flash ANE camera for android, aneandroid
Android native camera ANE packaged with opencv2.4.9 ndk
Not very useful now
Run in Nexus7-I (4.4.4)
But it is not available on Sony LT18i.
Private function openCam (): void {If (! Camera. isSupported)Return;Var cameraNam: Array =
Let's play the video function of the mobile phone. Do a demo.
look at the recording process:
Copy Code code as follows:
Mediarecorder = new Mediarecorder ();//Create Mediarecorder Object
Set the recording video source to camera (camera)
Mediarecorder.setvideosource (MediaRecorder.VideoSource.CAMERA);
Set the package format for the video after the recording is complete THREE_GPP to 3gp.mpeg_
The calling process of camera in android can be divided into the following layers:Package-> framework-> JNI-> camera (CPP) -- (binder) --> cameraservice-> camera Hal-> camera driver
Take the photo taking process as an example:1. After each parameter is set, after focusing is
One in Android, the ACTION that corresponds to the photo is Android.provider.MediaStore.ACTION_IMAGE_CAPTURE. The activity used for taking pictures needs to return the photo image data,The ACTION that corresponds to the camera is Android.provider.MediaStore.ACTION_VIDEO_CAPTURETherefore, you need to use Startactivityforresult () to start the Activity. The code is as follows:Intent Intent = new Intent (media
This example describes the use of Countdowntimer countdown in Android. Share to everyone for your reference, specific as follows:
In peacetime we are programmed, often use the countdown to this function, many people do not know that Android has helped encapsulate a class, often write their own. Now that this class has been found, we share it:
In a TextView continuously display the remaining time, the code
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.