热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何使用phonegap扫描条形码-howtoscanbarcodeusingphonegap

IneedtoscanabarcodeusingphonegapinAndroidandiPhone.Isthereawaytodothis?我需要在Androi

I need to scan a barcode using phonegap in Android and iPhone. Is there a way to do this?

我需要在Android和iPhone上使用phonegap扫描条形码。有办法吗?

5 个解决方案

#1


11  

This link leads you to a page where you can learn how to implement the PhoneGap Barcode Scanner plugin in your application

这个链接将引导您进入一个页面,在这个页面中,您可以学习如何在应用程序中实现PhoneGap条形码扫描器插件

#2


47  

Kris Erickson is correct, the Zxing & Phonegap projects has already taken care of the heavy lifting for you. (My current SO reputation disallows me from commenting, but I would have.)

克里斯·埃里克森(Kris Erickson)是对的,Zxing & Phonegap项目已经为您解决了繁重的工作。(我目前的SO声誉不允许我发表评论,但我会这么做。)

I've just made an Phonegap/Android app that scans a QR barcode using the plugin here. Follow the instructions and you should be successful. It's possible that the plugin has been written since Kris's answer.

我刚刚做了一个Phonegap/Android应用,用这个插件扫描二维码。按照指示去做,你就会成功。这个插件有可能是在Kris回答之后编写的。

The Javascript is simple, taken straight from https://github.com/phonegap/phonegap-plugins/

Javascript很简单,直接取自https://github.com/phonegap/phonegap-plugins/。

    var scanBarcode = function() {
    window.plugins.barcodeScanner.scan( BarcodeScanner.Type.QR_CODE,function(result) {
        alert("We got a barcode: " + result);
    }, function(error) {
        alert("Scanning failed: " + error);
    }, {yesString: "Install"}
    );
 }      

#3


10  

Your going to have a build a Phonegap plug-in, but the hard work has already be done for you by zxing.

您将构建一个Phonegap插件,但是辛苦的工作已经通过zxing完成了。

#4


1  

I recently used the ZBar plugin + the PhoneGap plugin to access ZBar. More details here - http://blog.infoentropy.com/Use_ZBar_barcode_reader_with_PhoneGap.

我最近使用了ZBar插件+ PhoneGap插件来访问ZBar。这里有更多的详细信息——http://blog.infoentropy.com/Use_ZBar_barcode_reader_with_PhoneGap。

#5


0  

https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner here is some useful example that help to do your solution https://build.phonegap.com/plugins/13

这里有一些有用的示例,可以帮助您完成您的解决方案https://build.phonegap.com/plugins/tree/master/android/barcodescanner


推荐阅读
author-avatar
小短腿Tel
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有