-
Notifications
You must be signed in to change notification settings - Fork 97
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 support #82
Comments
This would be an interesting enhancement, but not something that I'm likely to implement myself. It would probably be just another I wonder if we start requiring Java 11 or Java 17 in the next few years, whether that closes the door on any Android support in the future? |
I understand. Right now Android is supporting partial Java 8 syntax, so it will definitely always be behind in version support: https://developer.android.com/studio/write/java8-support. So supporting Android will sadly mean having to support lower Java versions for longer, yes. |
not only provide uk.org.okapibarcode.output.SymbolRenderer implementation ,also to provide the Symbol refrence awt class |
Just an update: Some work was already done in release 0.4.0 to remove most of the AWT class usage (except in the Java2D renderer). This should go a long way to helping users to more easily incorporate Okapi into Android projects. |
You can use the SvgRenderer on Android and convert the svg result to a Bitmap using androidsvg for example. |
Thanks for the suggestion, have you used this approach yourself in an application? The only possible gap I see is that the |
Yes i tried this approach and it is working fine! Regarding the |
Great, thanks for the confirmation! Hopefully it will help others who have similar needs. One last question, if you don't mind: if you're using Okapi version 0.4.x (with most of the references to the AWT classes removed), did you have to fork and customize Okapi in order to use it on Android? Or did it work out of the box for you? I'm not very familiar with Android development, so I'm not sure how easy or hard it is to use Okapi 0.4.x on Android, or where the remaining roadblocks are (if any). |
No i didn't have to fork or customize Okapi in order to use it on Android. This is working out of the box as, in contrary to the Java2D renderer, there are no java.awt references in the SvgRenderer. |
That's great to hear! I'll add a blurb to the README with this recommendation for Android developers, close this ticket out, and if anyone runs into more specific Android issues then we can address them in a separate ticket. |
Hey devs!
I'd like to try this library on Android because it supports outputting way more barcode formats than zxing support, so I am hoping I can fix CatimaLoyalty/Android#181 using this library.
I however can't seem to use this library because all the renderers depend on java.awt, which is not supported on Android.
Are there any plans on perhaps supporting Android? I sadly do not think I can help much myself, given I am not very knowledgeable at image drawing, but a renderer that creates an Android Bitmap would most likely be the most convenient way for Android users to be able to use this library too.
The text was updated successfully, but these errors were encountered: