Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b1zantine/ZXing-Orient
An Barcode Scanner Library based on the ZXing Library with support for Portrait Orientation.
https://github.com/b1zantine/ZXing-Orient
Last synced: 3 months ago
JSON representation
An Barcode Scanner Library based on the ZXing Library with support for Portrait Orientation.
- Host: GitHub
- URL: https://github.com/b1zantine/ZXing-Orient
- Owner: b1zantine
- License: apache-2.0
- Created: 2016-01-10T16:40:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-29T02:00:29.000Z (over 8 years ago)
- Last Synced: 2024-04-10T01:10:12.700Z (7 months ago)
- Language: Java
- Homepage:
- Size: 3.33 MB
- Stars: 74
- Watchers: 9
- Forks: 24
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZXing Orient [ ![Download](https://api.bintray.com/packages/sudarabisheck/maven/ZXing-Orient/images/download.svg) ](https://bintray.com/sudarabisheck/maven/ZXing-Orient/_latestVersion) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ZXing--Orient-green.svg?style=true)](https://android-arsenal.com/details/1/3213)
An Android Library based on [ZXing Library](https://github.com/zxing/zxing) with support for `Portrait Orientation` and some cool stuffs.
### Screenshots
## Basic Setup
1. Provide the gradle dependency
```gradle
compile 'me.sudar:zxing-orient:2.1.1@aar'
```2. Start the Scanner
```java
new ZxingOrient(MainActivity.this).initiateScan();
```3. Handle the Result
```java
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent){
ZxingOrientResult scanResult =
ZxingOrient.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
// handle the result
...
}
...
}
```**Note :** In `API 23` and above, don't forget to request permission for `Manifest.permission.CAMERA` before calling ZXing Orient.
## Advanced Setup
- Selection of Specific Barcode Types:
```java
void initiateScan(Collection desiredBarcodeFormats);
void initiateScan(Collection desiredBarcodeFormats, int cameraId)
```Some Formats include:
```java
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](https://github.com/SudarAbisheck/ZXing-Orient/blob/master/zxing-orient/src/main/java/me/sudar/zxingorient/Barcode.java)
- Selection of Camera```java
void initiateScan(int cameraId);
void initiateScan(Collection desiredBarcodeFormats, int cameraId);
```- UI Settings
```java
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
.setBeep(false) // Doesn't play beep sound
.setVibration(true) // Enables the vibration
.initiateScan();
```## Generate QR Codes
To generate QR codes add this line when necessary
```java
new ZxingOrient(thisActivity).shareText("Some Random Text");
```# License
This library is available under the [Apache License, Version 2.0.](https://github.com/SudarAbisheck/ZXing-Orient/blob/master/LICENSE)