Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/zxing-cpp/wrappers/android/README.md @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 # ZXing-C++ Android Library | |
| 2 | |
| 3 ## Install | |
| 4 | |
| 5 The easiest way to use the library is to fetch if from _mavenCentral_. Simply add **one** of the following two lines | |
| 6 ```gradle | |
| 7 implementation("io.github.zxing-cpp:android:2.2.0") | |
| 8 implementation("io.github.zxing-cpp:android:2.3.0-SNAPSHOT") | |
| 9 ``` | |
| 10 to your `build.gradle.kts` file in the `dependencies` section. To access the SNAPSHOT version, you also need to add a separate repositories entry in your `build.cradle.kts` file: | |
| 11 | |
| 12 ```gradle | |
| 13 maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots") } | |
| 14 ``` | |
| 15 | |
| 16 ## Use | |
| 17 | |
| 18 A trivial use case looks like this (in Kotlin): | |
| 19 | |
| 20 ```kotlin | |
| 21 import zxingcpp.BarcodeReader | |
| 22 | |
| 23 var barcodeReader = BarcodeReader() | |
| 24 | |
| 25 fun process(image: ImageProxy) { | |
| 26 image.use { | |
| 27 barcodeReader.read(it) | |
| 28 }.joinToString("\n") { result -> | |
| 29 "${result.format} (${result.contentType}): ${result.text}" | |
| 30 } | |
| 31 } | |
| 32 ``` | |
| 33 | |
| 34 ## Build locally | |
| 35 | |
| 36 1. Install AndroidStudio including NDK and CMake (see 'SDK Tools'). | |
| 37 2. Open the project in folder containing this README. | |
| 38 3. The project contains 2 modules: `zxingcpp` is the wrapper library, `app` is the demo app using `zxingcpp`. | |
| 39 | |
| 40 To build the AAR (Android Archive) from the command line: | |
| 41 | |
| 42 $ ./gradlew :zxingcpp:assembleRelease | |
| 43 | |
| 44 Then copy `zxingcpp/build/outputs/aar/zxingcpp-release.aar` into `app/libs` of your app. | |
| 45 | |
| 46 |
