Android: Most common pitfalls
1. What DecodingSpeed
and BarkoderResolution
options are available in barKoder?
#
barKoder supports different DecodingSpeed
settings — Fast, Normal, and Slow — as well as various BarkoderResolution
options to balance performance and scanning accuracy based on your application's needs.
HD("HD", 1280, 720),
FHD("Full HD", 1920, 1080),
UHD("Ultra HD 4k", 3840, 2060),
DecodingSpeeds
Fast(0),
Normal(1),
Slow(2),
Rigorous(3);
Example:
config.decoderConfig.decodingSpeed = Barkoder.DecodingSpeed.Slow;
config.barkoderResolution = BarkoderResolution.FHD;
2. How can I add a delay before scanning starts in the barKoder SDK to avoid capturing blurry images and allow multiple barcodes to be detected? #
You can achieve this behavior by separating the camera start and the scanning start, and adding a delay before starting the scanning process. This way, the camera will open first and have time to stabilize the focus before scanning begins. You can implement it like this :
bkdView.startCamera();
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
bkdView.startScanning(MainActivity.this);
}
}, 3000); // 3000 milliseconds = 3 seconds delay
This will wait 3 seconds after opening the camera before starting the scanning, which helps avoid capturing blurred images right after opening. If needed, you can adjust the delay duration to fit your use case.
3. How can I enable double-tap to freeze the camera preview in AR mode? #
Answer - In AR mode, double-tap allows you to freeze the camera preview and select/deselect barcodes on the frozen screen.
Example:
config.arConfig.doubleTapToFreezeEnabled = false;