# BarcodeScanResult

`BarcodeScanResult` is a result class that contains all decoded barcodes and their associated info from a single scan.

## Definition

*Assembly:* DynamsoftBarcodeReaderBundle.aar

*Namespace:* com.dynamsoft.dbrbundle.ui

```java
class BarcodeScanResult
```

## Methods

| Method | Description |
| ------ | ----------- |
| [`getBarcodes`](#getbarcodes) | Returns an array of [`BarcodeResultItem`](https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/api-reference/barcode-result-item.md), which represents a single barcode result. |
| [`getResultStatus`](#getresultstatus) | Returns the status of the `BarcodeScanResult`, which can indicate success or failure. |
| [`getErrorCode`](#geterrorcode) | Returns the error code should something go wrong during the barcode recognition process. |
| [`getErrorString`](#geterrorstring) | Returns the error message associated with the error code should something go wrong during the barcode recognition process. |

### getBarcodes

Returns an array of [`BarcodeResultItem`](https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/api-reference/barcode-result-item.md), which represents a single barcode result and is the most basic unit of the captured results.

```java
BarcodeResultItem[] getBarcodes();
```

**Return Value**

An array of [`BarcodeResultItems`](https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/api-reference/barcode-result-item.md). Each [`BarcodeResultItem`](https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/api-reference/barcode-result-item.md) corresponds to a single barcode.

### getResultStatus

Returns the status of the `BarcodeScanResult`, which can be one of *finished*, *canceled* or *exception*.

```java
@EnumResultStatus
int getResultStatus();
```

**Return Value**

The status of the barcode result, of type [EnumResultStatus](https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/api-reference/barcode-scanner/enum-result-status.md).

- `RS_FINISHED`: The barcode scanning is finished.
- `RS_CANCELED`: The barcode scanning activity is closed before the process is finished.
- `RS_EXCEPTION`: Failed to start barcode scanning or an error occurs when scanning the barcodes.

### getErrorCode

Returns the error code should something go wrong during the barcode recognition process.

```java
int getErrorCode();
```

**Return Value**

An integer representing a [`EnumErrorCode`](https://www.dynamsoft.com/capture-vision/docs/mobile/programming/android/api-reference/core/enum/error-code.md).

### getErrorString

Returns the error message associated with the error code should something go wrong during the barcode recognition process.

```java
String getErrorString();
```

**Return Value**

A string representing the message of a [`EnumErrorCode`](https://www.dynamsoft.com/capture-vision/docs/mobile/programming/android/api-reference/core/enum/error-code.md).
