Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/nbproject/private/
/build/
/dist/
/dist/
/target
/common/target
/javase/target
/android/target
/win/target
/ios/target
/javascript/target
/lib/target
/tests/**/target
12 changes: 12 additions & 0 deletions .idea/codenameone-maven-manual.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,28 @@ How to use
Installation
------------

1. Install the [cn1-codescan](https://github.com/codenameone/cn1-codescan) library into your project.
1. Build or download the [QRScanner.cn1lib](bin/QRScanner.cn1lib) file.
2. Put the file the `libs` folder of your project.
3. Right-click on your project and choose `Refresh Libs`
### Maven Projects

Add the following dependency to your project's common/pom.xml file:

```xml
<dependency>
<groupId>com.codenameone</groupId>
<artifactId>qrscanner-lib</artifactId>
<version>2.0.2</version>
<type>pom</type>
</dependency>
```

If you want to hack on the sources, and use a modified version, you can just clone this repository and run `mvn install` to install it into your local Maven repository.

### Ant Projects

Use Codename One Preferences to install the QRScanner library.

or

Build this project from source, then find the `.cn1lib` file in the `common/target` directory, and copy it to the "libs" directory of your Codename One application project, and select "Refresh Libs".

Example Code
------------
Expand Down Expand Up @@ -52,3 +70,18 @@ if (CodeScanner.getInstance() != null) {
Dialog.show("Not Supported","QR Code Scanning is not available on this device","OK",null);
}
```

## Configuring Types to Scan For

By default, the scanner will look for bar codes of type `EAN13` in barcode scanning mode, and `QR_CODE` in QR code scanning mode.
If you want to detect ALL supported code types, you can call the following before making the call to scan the code:

```java
Display.getInstance().setProperty("scanAllCodeTypes", "true");
```

## Building from Source

1. Clone this repository
2. Set JAVA_HOME to a JDK 1.8 or JDK 11 installation
3. mvn install
Binary file removed Stubber.jar
Binary file not shown.
Binary file removed ZBarScannerLibrary.aar
Binary file not shown.
Loading