Git Product home page Git Product logo

zxing-orient's Introduction

ZXing Orient Download

An Android Library based on ZXing Library with support for Portrait Orientation and some cool stuffs.

Screenshots

Portrait Screenshot Landscape Screenshot

Basic Setup

  1. Provide the gradle dependency

    compile 'me.sudar:zxing-orient:2.0.0@aar'
  2. Start the Scanner

    new ZxingOrient(MainActivity.this).initiateScan();
  3. Handle the Result

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent intent){
    
        ZxingOrientResult scanResult = 
                           ZxingOrient.parseActivityResult(requestCode, resultCode, intent);
                            
        if (scanResult != null) {
            // handle the result
            ...
        }
        ...
    }

Advanced Setup

  • Selection of Specific Barcode Types:

    void initiateScan(Collection<String> desiredBarcodeFormats);
    
    void initiateScan(Collection<String> desiredBarcodeFormats, int cameraId)

    Some Formats include:

    Barcode.PRODUCT_CODE_TYPES /** Collection of UPC_A, UPC_E, EAN_8, EAN_13, RSS_14 **/
    
    Barcode.ONE_D_CODE_TYPES /** Collection of UPC_A, UPC_E, UPC_EAN_EXTENSION, EAN_8, EAN_13, 
                                     CODABAR, CODE_39, CODE_93, CODE_128, ITF, RSS_14, RSS_EXPANDED **/
    
    Barcode.TWO_D_CODE_TYPES /** Collection of QR_CODE, DATA_MATRIX, PDF_417, AZTEC **/
    
    
    Barcode.EAN_8 
    Barcode.RSS_14
    Barcode.CODABAR ...
    
    Barcode.QR_CODE
    Barcode.DATA_MATRIX ...

    For all other supported types, take a look at Barcode.java

  • Selection of Camera

    void initiateScan(int cameraId);
    
    void initiateScan(Collection<String> desiredBarcodeFormats, int cameraId);
  • UI Settings

    ZxingOrient integrator = new ZxingOrient(MainActivity.this);
    integrator.setIcon(R.drawable.custom_icon)   // Sets the custom icon
    .setToolbarColor("#AA3F51B5")       // Sets Tool bar Color
    .setInfoBoxColor("#AA3F51B5")       // Sets Info box color
    .setInfo("Scan a QR code Image.")   // Sets info message in the info box
    .initiateScan(Barcode.QR_CODE);
    
    new ZxingOrient(Activity.this)
    .showInfoBox(false) // Doesn't display the info box  
    .initiateScan();   

Generate QR Codes

To generate QR codes add this line when necessary

new ZxingOrient(thisActivity).shareText("Some Random Text");

License

This library is available under the Apache License, Version 2.0.

zxing-orient's People

Contributors

b1zantine avatar

Watchers

wangchang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.