ZXing机器人使用前置摄像头 [英] ZXing android use front camera

查看:593
本文介绍了ZXing机器人使用前置摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个QR code阅读下面这个教程

I'm trying to build a QR Code reader following this tutorial

http://$c$c.tutsplus.com/tutorials/android-sdk-create-a-bar$c$c-reader--mobile-17162

我设法让不同的是我需要的相机是我的设备的前置摄像头,而不是后置摄像头一切工作。我无法找到,让我改变这个教程的任何地方。我尝试如下的<一个href="http://stackoverflow.com/questions/8642112/how-to-integrate-zxing-api-with-front-camera-in-android">this回答,但我仍然无法得到它的工作。

I managed to get everything working, except that I need the camera to be the front camera of my device instead of the rear camera. I can't find any place in the tutorial that allows me to change this. I tried following this answer, but I still could not get it to work.

主要是,我的问题是导入库。我碰到下面的错误。

Mainly, my issue is with importing the library. I get the following error.

operator is not allowed for source level below 1.7

当我把我的编译器设置到1.7,我得到这个

When I set my compiler settings to 1.7, I get this

Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead

我不完全很精通Android和我道歉,如果它可能不是一个很好的问题。

I'm not exactly very proficient with Android and I apologize if it might not be a good question.

所以,没有办法,我使用ZXing在我的应用程序的前置摄像头?任何链接?

So, any way for me to use ZXing with the front camera in my app? Any links?

非常感谢你。

推荐答案

该人士$ ​​C $ C使用Java 7的Andr​​oid不需要的Java&LT; = 6。你可以看到,在该项目中提供的构建愉快饲料的Java 7字节code到DEX和生产工作的应用程序。我不知道你使用的是什么样的工具,表明并非如此。也许是老了。

The source code uses Java 7. Android does not require Java <= 6. You can see that the build provided in the project happily feeds Java 7 bytecode to dex and produces a working app. I am not sure what tool you are using that suggests otherwise. Maybe it is old.

您应该不需要复制,虽然编译该项目的code。为什么有此必要?使用 core.jar添加文件。

You should not need to copy and compile the project's code though. Why is that necessary? use the core.jar file.

您不需要任何这种使用前置摄像头。只是意向( https://github.com/zxing/zxing/wiki/调用扫描 - 通过意图),并设置额外的 SCAN_CAMERA_ID 摄像机的编号,你想 - 通常是1对前一个

You don't need any of this to use the front camera. Just invoke by Intent (https://github.com/zxing/zxing/wiki/Scanning-Via-Intent) and set extra SCAN_CAMERA_ID to the ID of the camera you want -- usually 1 for the front one.

这篇关于ZXing机器人使用前置摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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