Create a 2D barcode (e.g. QR code, data matrix, PDF417) on iPhone and Android

I need a library for creating a 2D barcode on iPhone and Android (and, preferably, WM7 and, possibly, j2me) - the idea is to transfer information to another device using the appropriate scanner (decoder). What are some good options?

ZXing is an option, in particular for the read / decode aspect, but I want to generate them on these devices.

+4
source share
9 answers

zxing will work for Android. The Java encoder was not ported to C ++ (feel free to log in and contribute ... it shouldn't be that hard.) Until this happens, I used the psytec encoder ( http://groups.google.com/group/zxing / msg / 27e421daeb510d0f ). Comments are in Japanese, but it's pretty simple.

I have nothing to add to WM7. It with#? There is a C # port for zxing, but I donโ€™t know who actively supports it, and I donโ€™t know if it includes an encoder.

+2
source

The best option is the ZXing library . I am not sure about the support of Windows Phone 7.

+3
source

I tried all the solutions described above without success, but then found this library: akopanev-iOS-QR-Code-Encoder

Open-source, easy to implement, has an example xcode project, works great

author - Andrey Kopanev

+3
source

I use ZXING to successfully encode QR barcodes. However, at least with the current version, it appears to have limited support for encoding other symbologies (for example: PDF-417).

I am using the following code snippet:

// Encode the bitmap and display it on the screen try { // This will produce a 150x150 QR Barcode and display it on the screen. Bitmap bm = encodeAsBitmap(barcodeContentString, BarcodeFormat.QR_CODE, 150, 150); if(bm != null) { barcodeImage.setImageBitmap(bm); } } catch (WriterException e) { ... } 

In this example, "barcodeContentString" is the data that is being encoded. "BarcodeImage" is a standard ImageView.

I do not show it here, but I turn on the screen for the entire time that the barcode is displayed. This way, I can successfully scan the barcode using a QR barcode scanner.

+2
source

If you intend to switch to another device online, you can use a third-party QR-code API to receive the image. Making a REST API call is the best option for cross-platform mobile applications.

This API does this for the URI: http://www.tag.cx/qr-codes/

You can also host your own custom QR code generator.

+1
source

Here is another version of Java: http://qrcode.sourceforge.jp/

Summary - โ€œThis project develops and distributes a QR Code decoding / encoding library for GPL v2. The goal of the project is to use the embedded QR Code information for programmable devices around the world. QR code is an industry standard, JIS-X-0510 and ISO / IEC18004 . "

+1
source

Also check (I could not post them because stackoverflow prevented more than one URL): And the .net version (as indicated on the site above): http://www.codeproject.com/KB/cs/qrcode.aspx

+1
source

Also check (I could not post them because stackoverflow prevented more than one URL): python version (as indicated on the site above): http://pyqrcode.sourceforge.net/

+1
source

I might be late to help you, but I found a good SDK for data matrix codes. Additional instructions are on their website HERE , but to provide the code here, you would do something like this:

 OBLinear *pLinear = [OBLinear new]; [pLinear setNBarcodeType: OB_CODE128A]; [pLinear setPDataMsg: [[NSString alloc] initWithString:@"AB"]]; //[pLinear setPSupData: [[NSString alloc] initWithString:@"14562"]]; [pLinear setFX: USER_DEF_BAR_WIDTH]; [pLinear setFY: USER_DEF_BAR_HEIGHT]; [pLinear setFLeftMargin:USER_DEF_LEFT_MARGIN]; [pLinear setFRightMargin:USER_DEF_RIGHT_MARGIN]; [pLinear setFTopMargin:USER_DEF_TOP_MARGIN]; [pLinear setFBottomMargin:USER_DEF_BOTTOM_MARGIN]; [pLinear setNRotate:OB_Rotate0]; UIFont *pTextFont = [UIFont fontWithName: @"Arial" size: 8.0f]; [pLinear setPTextFont: pTextFont]; [pLinear drawWithView:self.view]; 
0
source

Source: https://habr.com/ru/post/888758/


All Articles