B4A Class Re: [class] Google Code Scanner

i modified erel's recent Google Code Scanner class

it includes the barcode type detected, which may be of interest if multiple formats have been enabled. the result returned to b4xmainpage includes the type.

replace or modify the original class (in situ) and replace the button1_click sub in b4xmainpage with this:

B4X:
    Dim formats As List = Array(Scanner.FORMAT_ALL_FORMATS) 'For better performance pass the specific formats needed.
    Wait For (Scanner.Scan(formats)) Complete (Result As ScannerResult)
    If Result.Success Then
        MsgboxAsync(Result.format & ": " & Result.Value, "Your scan:")
        wait for msgbox_result(res As Int)
    End If

class is attached.
 

Attachments

  • GoogleCodeScanner.zip
    1.2 KB · Views: 26
  • result.png
    result.png
    8.7 KB · Views: 47
  • barcode.jpg
    barcode.jpg
    39.2 KB · Views: 44
Top