Skip to content

Commit 5ca1e07

Browse files
committed
Documented Android flash:"on" quirk after finding out that setting focus mode to CONTINUOUS_PICTURE or CONTINUOUS_VIDEO actually gave poorer results (flash only turned on during the first autofocus attempt, if at all - may be device dependent)
1 parent 0b0699f commit 5ca1e07

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Arguments:
2626
text_title: "OPTIONAL Title Text - default = 'Scan QR Code'", // Android only
2727
text_instructions: "OPTIONAL Instruction Text - default = 'Please point your camera at the QR code.'", // Android only
2828
camera: "front" || "back" // defaults to "back"
29-
flash: "on" || "off" || "auto" // defaults to "auto"
29+
flash: "on" || "off" || "auto" // defaults to "auto". See Quirks
3030
}
3131
```
3232

@@ -43,3 +43,8 @@ Status:
4343

4444
- Android: DONE
4545
- iOS: DONE
46+
47+
Quirks:
48+
49+
- __Android__: Flash "on" may cause the flash to alternate between on and off
50+
at about a half second/one second interval, instead of making it stay on...

android/ZBarScannerActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,11 @@ private void tryStartPreview () {
342342
camera.setPreviewDisplay(holder);
343343
camera.setPreviewCallback(previewCb);
344344
camera.startPreview();
345-
camera.autoFocus(autoFocusCb);
345+
camera.autoFocus(autoFocusCb); // We are not using any of the
346+
// continuous autofocus modes as that does not seem to work
347+
// well with flash setting of "on"... At least with this
348+
// simple and stupid focus method, we get to turn the flash
349+
// on during autofocus.
346350
} catch (IOException e) {
347351
die("Could not start camera preview: " + e.getMessage());
348352
}

0 commit comments

Comments
 (0)