New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android wrapper improvements #659
Merged
axxel
merged 24 commits into
zxing-cpp:master
from
kurzdigital:android_wrapper_improvements
Nov 14, 2023
Merged
Android wrapper improvements #659
axxel
merged 24 commits into
zxing-cpp:master
from
kurzdigital:android_wrapper_improvements
Nov 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And allocate the Result object(s) on the C++ side, and only if something was found.
Except `version` and `GTIN`, as requested. `version` is about to be deprecated.
Now you can run this to publish the the library in your local Maven repository: $ ./gradlew publishToMavenLocal Then you can include the library in any project (on your machine) by adding this to `dependencies` in `app/build.gradle`: implementation 'com.zxingcpp:zxingcpp:2.1.0' Of course, for this to work you need to add `mavelLocal()` to your `repositories` in your top level `build.gradle`: repositories { mavenLocal() … } To publish the library in a public remote Maven repository, we need to add the corresponding credentials.
Because the term "ZXingCpp" is more clear and there will probably be write support some day, too.
Instead of an object field. This makes the API a little bit more clear about side effects and also a bit more consistent.
Because ZXingCpp doesn't have any fields anymore. This way, ZXingCpp is more clear to the user about possible side effects.
As we use the term "DecodeHints" in other wrappers and because "Options" is a very general term. "DecodeHints" is more precise, and it's immediately clear for what these options are.
With Android Studio for the latest style changes.
To use tabs for indentation like the sample app does. There's no point in using a different indentation here.
Replace CR/LF by just LF, to match the rest of this project.
Add a space between slash and the first word like it's the case with every other comment around here.
Focus on the essentials.
If that blank line between the immutable and mutable fields is supposed to mean anything, `beeper` belongs to the first group as it is immutable.
So DecodeHints can be reused between scans and does not need to be allocated again. This is of advantage when using `read()` with a video stream because it avoids allocation in the hot path.
Can be generalized by using an additional function.
axxel
requested changes
Nov 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markusfisch thank you very much for your time spent on this.
@benjohnde If you have an opinion on the two comments I made regarding the use of optional types, please let us know.
wrappers/android/zxingcpp/src/main/java/com/zxingcpp/ZXingCpp.kt
Outdated
Show resolved
Hide resolved
Since there is `returnErrors` in `DecodeHints`, the `Result` should contain a corresponding `error` member.
These members can never be null.
`time` and `position` can never be null now.
To also know the error type on the JVM.
If the result is not valid. Also make `sequenceId` nullable, too.
Instead of returning null when no barcodes could be found. While this change makes it easier to deal with a reading result, it has the downside of needlessly allocating an empty ArrayList.
Progress. Awesome. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
And finally some improvements we haven't taked about yet: