# Class CodeScanner

java.lang.Object
com.codename1.codescan.CodeScanner

public abstract class CodeScanner extends Object

Deprecated!!: Please use the cn1-codescan library instead.

A barcode/qrcode scanner API, this class is a singleton, notice that this API might not be implemented for all platforms in which case the getInstance() method will return null!

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CodeScanner()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static CodeScanner`
  `getInstance()`
  Returns the instance of the code scanner, notice that this method is equivalent to Display.getInstance().getCodeScanner().
  `abstract void`
  `scanBarCode(ScanResult callback)`
  Scans based on the settings in this class and returns the results
  `abstract void`
  `scanQRCode(ScanResult callback)`
  Scans based on the settings in this class and returns the results

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CodeScanner

    public CodeScanner()

- ## Method Details

  - ### getInstance

    public static CodeScanner getInstance()

    Returns the instance of the code scanner, notice that this method is equivalent to Display.getInstance().getCodeScanner().

    ###### Returns

    instance of the code scanner

  - ### scanQRCode

    public abstract void scanQRCode(ScanResult callback)

    Scans based on the settings in this class and returns the results

    ###### Parameters

    - `callback`: scan results

  - ### scanBarCode

    public abstract void scanBarCode(ScanResult callback)

    Scans based on the settings in this class and returns the results

    ###### Parameters

    - `callback`: scan results