0

Im very new to Java/Android. I dont have a sense for how to go about adding the Zxing barcode scanner into my project in such a way that will allow me to extend the appropriate classes to change the library's functionality.

For example I would like to change the focus mode from "auto" to "macro" and also change a line in InactivityTimer.java for a shorter delay time:

private static final long INACTIVITY_DELAY_MS = 5 * 60 * 1000L;

How can I extend these classes to make these changes?

currently I have Zxing added to my project via appending the GIT source to my build.gradle dependencies like so:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'

    compile 'com.journeyapps:zxing-android-embedded:3.0.3@aar'
    compile 'com.google.zxing:core:3.2.0'
}

Also I found a few posts on the web about the subject but even after reading them I still cant seem to see the pattern and I feel like I might simply just be missing something fundamental.

Please and thanks for any advise!

Community
  • 1
  • 1
Logic1
  • 1,806
  • 3
  • 26
  • 43

1 Answers1

0

Importing project via gradle means you can only use API that the developers provide to you, but

ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library.

This means you can be a part of its cotributors. You can pull the code, embed it in your project, modify it and even contribute your modifications back to the community to share with the world. As for changes you want to implement: you need to read carefully ZXing documentation. For example, the class responsible for Focus_MODE is CameraConfigurationManager.java

The best part of it, that when you become an open-source community contributor - you can work with other people on the same tasks and communicate with developers on native forum, where people that know each symbol in their code will be glad to help.

Evgeniy Mishustin
  • 3,343
  • 3
  • 42
  • 81