代码改变世界

google zxing 二维码扫描(android client分析)

2013-11-25 18:06  硕硕  阅读(2731)  评论(0编辑  收藏  举报

一.总体架构

 

二.架构分析

1. com.google.zxing.client.android

  

AmbientLightManager 环境光线管理

Detects ambient light and switches on the front light when very dark, and off again when sufficiently light.

当在前灯非常黑暗的时候检测环境光和开关,当光线充足的时候尝试关闭

 

BeepManager 声音和震动管理

Manages beeps and vibrations for {@link CaptureActivity}

管理声音和震动 需要链接CaptureActivity

 

CaptureActivity 主avcivity,初始界面,捕获界面

This activity opens the camera and does the actual scanning on a background thread. It draws a viewfinder to help the user place the barcode correctly,shows feedback as the image processing is happening, and then overlays the results when a scan is successful.

此activity开启相机,并在后台线程上做实际的扫描。它绘制了取景器,以帮助用户正确地将条形码,显示反馈为作为图像进行处理,当扫描成功时候覆盖结果。