Android Camera2示例 [英] Android Camera2 Sample

查看:337
本文介绍了Android Camera2示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图找到适用于android的相机示例,因为我希望将其弄乱,看看我能做什么.我正在使用导入android代码示例"中的示例代码,并使用Camera2.我有点了解它是如何工作的,但是我想在我的手机上试用它,它是android 4.4,而5.0是唯一需要的版本.最小sdk是5.0,如果更改的错误是.错误:任务':Application:processDebugTestManifest'的执行失败.

I am trying to find a camera sample for android because I would love to mess with it and see what I can do. I am using the sample code from "Import an android code sample" and using Camera2. I somewhat get how it works however I would want to try it on my phone which is android 4.4 and 5.0 is the only required version. the minimum sdk is 5.0 and if changed error is. `Error:Execution failed for task ':Application:processDebugTestManifest'.

com.android.manifmerger.ManifestMerger2 $ MergeFailureException:org.xml.sax.SAXParseException; lineNumber:20; columnNumber:10;

com.android.manifmerger.ManifestMerger2$MergeFailureException: org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 10; The processing instruction target matching "[xX][mM][lL]" is not allowed.`

错误是这样的,它说声明必须继续所有文档内容" 它还说无法解析camera2basic的符号

the error is this and it says "Declarations must proceed all document content" It also says cannot resolve symbol for camera2basic

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->


<instrumentation
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="com.example.android.camera2basic"
        android:label="Tests for com.example.android.camera2basic" />

所以我的问题是,有没有一种方法可以使它不仅仅可以被访问?还是还有另外一个示例代码可供我用来玩弄和弄乱

So my question is Is there a way to make it accessible to more than just lollop? Or is there another sample code that is out there that I can use to play with and mess around with

推荐答案

camera2 API在Android 5.0之前不存在,因此您不能在运行Android 4.4的设备上使用它.

The camera2 API does not exist prior to Android 5.0, so you cannot use it on a device running Android 4.4.

您可以在此处遵循旧相机API的API指南: http://developer.android.com/guide/topics/media/camera.html#custom-camera

You can follow the API guide for the older camera API here instead: http://developer.android.com/guide/topics/media/camera.html#custom-camera

这篇关于Android Camera2示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆