Encoding-with-zxing/README.md

45 lines
1.5 KiB
Markdown
Raw Normal View History

2017-01-17 21:11:58 +00:00
# Encoding-with-zxing Android
2017-01-17 16:14:36 +00:00
Encoding with zxing (Qr code, PDF 417)
2017-01-17 16:26:54 +00:00
2017-01-17 21:11:58 +00:00
#Add library dependency
2017-01-17 16:26:54 +00:00
2017-01-17 16:37:35 +00:00
First add encoding_zxing_lib in your project
Then :
2017-01-17 16:26:54 +00:00
compile project(path: ':encoding_zxing_lib')
2017-01-17 16:32:06 +00:00
2017-01-17 21:11:58 +00:00
#To generate encode of QrCode
2017-01-17 16:32:06 +00:00
Example -1
2017-01-17 16:35:58 +00:00
EncodingZxing.encodeToQrCode(text, size);
---------------------------------
EncodingZxing.encodeToQrCode("Encoding with zxing", 500));
---------------------------------
2017-01-17 16:32:06 +00:00
imageView.setImageBitmap(EncodingZxing.encodeToQrCode("Encoding with zxing", 500));
Example -2
EncodingZxing.encodeToQrCode(text,
width,
height,
dotColor,
backgroundColor);
---------------------------------
EncodingZxing.encodeToQrCode("Encoding with zxing",
400,
400,
Color.BLACK,
Color.WHITE);
2017-01-17 16:26:54 +00:00
2017-01-17 21:11:58 +00:00
#To generate encode of PDF417
2017-01-17 16:26:54 +00:00
2017-01-17 16:35:58 +00:00
Example -1
EncodingZxing.encodeToPDF417(text, size, dotColor, backgroundColor)
---------------------------------
imageView.setImageBitmap(EncodingZxing.encodeToPDF417(text, size, dotColor, backgroundColor));
---------------------------------
2017-01-17 16:26:54 +00:00
imageView.setImageBitmap(EncodingZxing.encodeToPDF417("Encoding with zxing", 500, Color.BLACK, Color.WHITE));