ZBarScanLibrary

a zbar open source

License

License

GroupId

GroupId

com.github.xxl6097
ArtifactId

ArtifactId

zbarscanlibrary
Last Version

Last Version

1.0.7
Release Date

Release Date

Type

Type

aar
Description

Description

ZBarScanLibrary
a zbar open source
Project URL

Project URL

https://github.com/xxl6097/ZbarScanLibrary
Source Code Management

Source Code Management

https://github.com/xxl6097/ZbarScanLibrary.git

Download zbarscanlibrary

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.xxl6097/zbarscanlibrary/ -->
<dependency>
    <groupId>com.github.xxl6097</groupId>
    <artifactId>zbarscanlibrary</artifactId>
    <version>1.0.7</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.xxl6097/zbarscanlibrary/
implementation 'com.github.xxl6097:zbarscanlibrary:1.0.7'
// https://jarcasting.com/artifacts/com.github.xxl6097/zbarscanlibrary/
implementation ("com.github.xxl6097:zbarscanlibrary:1.0.7")
'com.github.xxl6097:zbarscanlibrary:aar:1.0.7'
<dependency org="com.github.xxl6097" name="zbarscanlibrary" rev="1.0.7">
  <artifact name="zbarscanlibrary" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.xxl6097', module='zbarscanlibrary', version='1.0.7')
)
libraryDependencies += "com.github.xxl6097" % "zbarscanlibrary" % "1.0.7"
[com.github.xxl6097/zbarscanlibrary "1.0.7"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

ZbarScanLibrary

Zar scan open source

ZbarScanLibrary是之前的ZBar解析二维码项目的重构和优化

  • 使用了最新版本的libiconv库进行编译,版本号:1.14;下载地址: http://www.gnu.org/software/libiconv/
  • 重新修改ZBar对中文的支持,并且可以解析GBK,UTF-8格式生成的二维码图片
  • 使用最新的ndk-r10d进行ndk-build,支持64位cpu

##使用步骤 1.在activity布局中加入如下:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <include
        layout="@layout/captrue_layout"/>

</RelativeLayout>

2.activity中生命周期设置:

public class GotoScanActivity extends Activity implements ZBarQrScanCallBack {

    private ZBarQrScanManager ZBarZBarQrScanManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_goto_scan);
        ZBarZBarQrScanManager = new ZBarQrScanManager();
        ZBarZBarQrScanManager.onCreate(this);
        ZBarZBarQrScanManager.setCallBack(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        ZBarZBarQrScanManager.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
        ZBarZBarQrScanManager.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ZBarZBarQrScanManager.onDestroy();
    }

    @Override
    public void onResult(String resuilt) {
        Toast.makeText(this, resuilt, Toast.LENGTH_SHORT).show();
        Intent resultIntent = new Intent();
        Bundle bundle = new Bundle();
        bundle.putString("result", resuilt);
        resultIntent.putExtras(bundle);
        this.setResult(RESULT_OK, resultIntent);
        finish();
    }

    @Override
    public void onException(Object object, Exception e) {

    }

##License

/*
 * Copyright (C) 2016 uuxia <[email protected]>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Versions

Version
1.0.7
1.0.6
1.0.5
1.0.4
1.0.2
1.0.1
1.0.0