Android:有没有办法将条码扫描器实现到应用程序中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2739550/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android: Is there a way to implement the barcode scanner into an app?
提问by James
So I'm working on a project, and I'm wondering if there is a way I can implement the barcode scanner into my android app? So it would go from my app, open the camera and take the "picture", get the info, and go back to my app with that info?
所以我正在做一个项目,我想知道是否有一种方法可以将条形码扫描仪实施到我的 android 应用程序中?所以它会从我的应用程序中打开相机并拍摄“照片”,获取信息,然后返回我的应用程序并使用该信息?
采纳答案by James
Here is an example of a third-party library for scanning barcodes: https://github.com/zxing/zxing/wiki/Scanning-Via-Intent
以下是用于扫描条码的第三方库示例:https: //github.com/zxing/zxing/wiki/Scanning-Via-Intent
回答by JasCav
As I am not an experienced Android developer, I don't know if you can talk back and forth between applications due to sandboxing. However, there is a barcode scanner called zxingwhich is "an open-source, multi-format 1D/2D barcode image processing library implemented in Java. Our focus is on using the built-in camera on mobile phones to photograph and decode barcodes on the device, without communicating with a server."
由于我不是经验丰富的Android开发人员,我不知道您是否可以由于沙盒而在应用程序之间来回交谈。但是,有一个叫做zxing的条码扫描器,它是“一个用 Java 实现的开源、多格式的一维/二维条码图像处理库。我们的重点是使用手机上的内置摄像头对条码进行拍照和解码。设备,无需与服务器通信。”
Seems pretty solid, so I would recommend using that.
看起来很坚固,所以我建议使用它。
回答by rahulrv
Android has its own barcode api
Android 有自己的条码 api
http://android-developers.blogspot.com/2015/08/barcode-detection-in-google-play.html?linkId=16316033
http://android-developers.blogspot.com/2015/08/barcode-detection-in-google-play.html?linkId=16316033
回答by jjclarkson
If you are more comfortable creating apps using App Inventor, there is a barcode module based off of the ZXing library: http://appinventor.googlelabs.com/learn/reference/components/other.html#BarcodeScanner
如果您更习惯使用 App Inventor 创建应用程序,则可以使用基于 ZXing 库的条形码模块:http: //appinventor.googlelabs.com/learn/reference/components/other.html#BarcodeScanner