Kotlin - How to read/write QR Code with ZXing » grokonez

Kotlin - How to read/write QR Code with ZXing » grokonez

Kotlin read write QR Code example - Kotlin read write QR Code ZXing example - Kotlin QR Code example

https://grokonez.com/kotlin/kotlin-read-write-qr-code-zxing

Kotlin – How to read/write QR Code with ZXing

In this tutorial, we're gonna look at Kotlin examples that read and write QR Code using ZXing.

I. Dependency

<dependency>
    <groupId>com.google.zxing</groupId>
    <artifactId>core</artifactId>
    <version>3.3.2</version>
</dependency>

<dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.3.2</version> </dependency>

II. Write Data to QR Code


package com.javasampleapproach.kotlin.qrcode

import java.io.IOException import java.nio.file.FileSystems import java.nio.file.Path import com.google.zxing.BarcodeFormat import com.google.zxing.WriterException import com.google.zxing.client.j2se.MatrixToImageWriter import com.google.zxing.common.BitMatrix import com.google.zxing.qrcode.QRCodeWriter

@Throws(WriterException::class, IOException::class) fun main(args: Array?) {

val qrCodeWriter = QRCodeWriter()
val bitMatrix = qrCodeWriter.encode(
        "JavaSampleApproach\nJava Technology, Spring Framework",
        BarcodeFormat.QR_CODE,
        350, 350) // width x height

val path = FileSystems.getDefault().getPath("JSA-QRCode.png")
MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path)

}

A QR Code is generated: JSA-QRCode

III. Read Data from QR Code

More at:

https://grokonez.com/kotlin/kotlin-read-write-qr-code-zxing

Kotlin – How to read/write QR Code with ZXing

kotlin qrcode zxing

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Kotlin App Development Company in India, Hire Kotlin Developers

Looking for Kotlin app developers in India? We are the best kotlin app development company in India offering top notch kotlin based application development services.

Hire Dedicated Kotlin Developer - WebClues Infotech

Request a free quote for custom web and mobile apps development, Enterprise solutions, IoT Solutions, AR/VR Development, Blockchain and chatbot services. Feel free to get in touch.

How to Develop an Android App with Kotlin?

AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!

Top Kotlin Android App Development Company in USA

AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!

Top-notch Kotlin App Development Company in USA

AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!