Android 二维码扫描工具 QRCodeReaderView
来源:互联网 发布:comicstudio软件 编辑:程序博客网 时间:2024/06/05 02:56
QRCodeReaderView 是基于 ZXING 条形码扫描工具项目改进,为了在肖像模式和增强现实目的下进行更简单的 Android 二维码检测。此项目可以在相机的预览中显示是否有二维码。
用法:
- Create an Activity which implements onQRCodeReadListener, and let implements required methods
- Make sure Activity orientation is PORTRAIT and give Camera permision in the manifest.xml
- Add a "QRCodeReaderView" in the layout editor like you actually do with a button for example
<com.dlazaro66.qrcodereaderview.QRCodeReaderView android:id="@+id/qrdecoderview" android:layout_width="match_parent" android:layout_height="match_parent" />
- In your onCreate method, you can find the view as usual, using findViewById() function.
- Set onQRCodeReadListener to the QRCodeReaderView.
- Start & Stop camera preview in onPause() and onResume() overriden methods.
- Use onQRCodeReadListener callbacks as you want.
- You can place widgets or views over QRDecoderView
public class DecoderActivity extends Activity implements OnQRCodeReadListener { private TextView myTextView; private QRCodeReaderView mydecoderview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_decoder); mydecoderview = (QRCodeReaderView) findViewById(R.id.qrdecoderview); mydecoderview.setOnQRCodeReadListener(this); myTextView = (TextView) findViewById(R.id.exampleTextView); } // Called when a QR is decoded // "text" : the text encoded in QR // "points" : points where QR control points are placed @Override public void onQRCodeRead(String text, PointF[] points) { myTextView.setText(text); } // Called when your device have no camera @Override public void cameraNotFound() { } // Called when there's no QR codes in the camera preview image @Override public void QRCodeNotFoundOnCamImage() { } @Override protected void onResume() { super.onResume(); mydecoderview.getCameraManager().startPreview(); } @Override protected void onPause() { super.onPause(); mydecoderview.getCameraManager().stopPreview(); }}
项目主页:http://www.open-open.com/lib/view/home/1446534728935
0 0
- Android 二维码扫描工具 QRCodeReaderView
- android 扫描二维码 生产二维码
- android二维码扫描及生成封装工具类
- Android 二维码扫描
- Android二维码扫描
- android二维码扫描 ZBar
- android 二维码扫描开发
- Android "QR二维码扫描"
- cocos2dx android 二维码扫描
- android 二维码 条形码扫描
- android二维码扫描
- Android扫描二维码
- Android二维码扫描、生成
- android 二维码 扫描
- Android二维码扫描
- Android二维码扫描
- android二维码的扫描
- android二维码扫描
- C++中cout.setf()函数
- cmake使用笔记和Creating CMake Linux projects with Visual Studio
- Nodejs中的异步编程类库Async
- nodejs 退出命令行
- FusionCharts Suite XT统计图表使用笔记(2)--创建图表过程步骤
- Android 二维码扫描工具 QRCodeReaderView
- 使用asm.jar将Android手机屏幕投影到电脑
- 51nod BSG白山极客挑战赛 AVL树的种类
- ZOJ 3861 Valid Pattern Lock(深度优先遍历dfs,有限制条件的全排列)
- 内存分析工具 MAT 的使用
- 数据存储知识(2)--Mysql查看执行计划
- iOS开发:发布证书无法安装,不能修改"System Roots"钥匙串
- SpringMVC接收ajax传送的参数,后台显示乱码
- STM32的中断