https://github.com/m1ga/ti.codescanner
Titanium module for the MLKit "Google code scanner" - Scan codes without any permission
https://github.com/m1ga/ti.codescanner
barcode-scanner mlkit-android qrcode-scanner titanium-mobile titanium-module
Last synced: about 1 year ago
JSON representation
Titanium module for the MLKit "Google code scanner" - Scan codes without any permission
- Host: GitHub
- URL: https://github.com/m1ga/ti.codescanner
- Owner: m1ga
- License: mit
- Created: 2022-06-20T12:16:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T06:54:12.000Z (over 1 year ago)
- Last Synced: 2025-03-29T01:12:49.044Z (about 1 year ago)
- Topics: barcode-scanner, mlkit-android, qrcode-scanner, titanium-mobile, titanium-module
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ti.codescanner - Titanium code scanner module for Android
## Scan codes (QR, Barcodes) without any camera permission!
Based on the MLKit Google code scanner (Beta) you can use this module to make a simple QR/Barcode scanner inside your app that don't need any camera permission!
If you'll need to customize your UI or want to scan text have a look at the demo of my ti.mlkit module.
## Example
```js
const win = Ti.UI.createWindow();
const codescanner = require("ti.codescanner");
codescanner.addEventListener("complete", e => {
console.log(e.value);
})
win.addEventListener("click", e => {
codescanner.scan({
autoZoom: false,
formats: [codescanner.FORMAT_QR_CODE] // only scan QR Codes
});
});
win.open();
```
## Events
* complete -> event.value
* cancel
* error -> event.message
## Methods
* scan({})
optional parameters:
* autoZoom: boolean
* formats: [int array of constants]
## Constants:
* FORMAT_UNKNOWN
* FORMAT_ALL_FORMATS
* FORMAT_CODE_128
* FORMAT_CODE_39
* FORMAT_CODE_93
* FORMAT_CODABAR
* FORMAT_DATA_MATRIX
* FORMAT_EAN_13
* FORMAT_EAN_8
* FORMAT_ITF
* FORMAT_QR_CODE
* FORMAT_UPC_A
* FORMAT_UPC_E
* FORMAT_PDF417
* FORMAT_AZTEC
## Known issues
On some phones the code scanner might not work or open/closes right away without any error. The `Google Play Services` could be an issue.
The Titanium module only calls one function from Googles library. If you have a non-working phone you would need to use their support pages: https://developers.google.com/ml-kit/community
## Author
- Michael Gangolf ([@MichaelGangolf](https://twitter.com/MichaelGangolf) / [Web](http://migaweb.de))