Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m1ga/hyperloop.barcode
Axway Hyperloop barcode scanner for Android
https://github.com/m1ga/hyperloop.barcode
Last synced: 3 months ago
JSON representation
Axway Hyperloop barcode scanner for Android
- Host: GitHub
- URL: https://github.com/m1ga/hyperloop.barcode
- Owner: m1ga
- License: other
- Created: 2017-05-25T11:02:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-01T19:10:09.000Z (almost 6 years ago)
- Last Synced: 2024-07-16T05:37:54.534Z (4 months ago)
- Language: JavaScript
- Size: 1.89 MB
- Stars: 5
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hyperloop.barcode
A barcode scanner example for Android using Hyperloop
![image](screen.png)
## Used library:
* https://github.com/dm77/barcodescanner
* https://github.com/zxing/zxing (zxing core)## Features:
* setFlash(true/false);
* getFlash();
* startCamera(id);
* getCamera();
* resume();
* stopCamera();
* getView();
* hasCameraPermissions();
* requestCameraPermissions(callback(true/false));## Example:
```javascript
var scanner = require("scanner");
var whichCam = 0;scanner.result(function(result) {
$.lbl.text = result.getText() + "\n" + result.getBarcodeFormat();// just wait a bit to resume
_.delay(function() {
scanner.resume();
}, 1000);
})$.btn_start.addEventListener("click", function(e) {
if (scanner.hasCameraPermissions()) {
scanner.startCamera(whichCam);
} else {
scanner.requestCameraPermissions(function(val){
if (val){
scanner.startCamera(whichCam);
} else {
alert("Permissions needed");
}
});
}
});$.btn_stop.addEventListener("click", function(e) {
scanner.stopCamera();whichCam = scanner.getCamera() + 1;
if (whichCam > 1) {
whichCam = 0;
}
});$.btn_flash.addEventListener("click", function(e) {
scanner.setFlash(!scanner.getFlash());
});$.index.addEventListener("open", function(e) {
});
$.view_cam.add(scanner.getView());
$.index.open();
```