Android library for creating QR-codes with logo, custom pixel/eyes shapes, background image. Powered by ZXing.

Last update: Jun 14, 2022

custom-qr-generator

Android library for creating QR-codes with logo, custom pixel/eyes shapes, background image. Powerd by ZXing.

Installation

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
      ...
        maven { url 'https://jitpack.io' }
    }
}

Or for gradle 7+ to settings.gradle file:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        ...
        maven {
            url 'https://jitpack.io'        
        }
    }
}

Step 2. Add the dependency.

dependencies {
    implementation 'com.github.alexzhirkevich:custom-qr-generator:1.2.0'
}

Usage

Step 1. Create QR code data. There are multiple QR types support: Plain Text, Url, Wi-Fi, Email, GeoPos, Profile Cards, Phone, etc.

val data = QrData.Url("https://example.com")

Step 2. Define styling options:

val options = QrOptions.Builder(1024)
    .setPadding(.3f)
    .setBackground(
        QrBackgroundImage(
            drawable = ContextCompat
                .getDrawable(this, R.drawable.frame)!!,
        )
    )
    .setLogo(
        QrLogo(
            drawable = ContextCompat
                .getDrawable(this, R.drawable.tg)!!,
            size = .2f,
            padding = .2f,
            shape = QrLogoShape
                .Circle
        )
    )
    .setColors(
        QrColors(
            dark = QrColor
                .Solid(Color.parseColor("#345288")),
            bitmapBackground = QrColor.Solid(Color.WHITE),
            codeBackground = QrColor
                .Solid(Color.parseColor("#ddffffff")),
        )
    )
    .setElementsShapes(
        QrElementsShapes(
            darkPixel = QrPixelShape
                .RoundCorners(),
            ball = QrBallShape
                .RoundCorners(.25f),
            frame = QrFrameShape
                .RoundCorners(.25f),
            background = QrBackgroundShape
                .RoundCorners(.05f)
        )
    )
    .build()

Step 2. Create a QR code generator and pass your data and options into it:

val generator: QrCodeGenerator = QrGenerator()
  
val bitmap = generator.generateQrCode(data, options)

It is better to perform QR codes generating in background thread. Generator supports cancellation with coroutines.

val bitmap = generator.generateQrCodeSuspend(data, options)

Customization

You can easily implement your own shapes and coloring for QR Code elements using math formulas. For example, this is implementation of Circle QR-pixels:

object Circle : QrPixelShape {
    override fun invoke(
        i: Int, j: Int, elementSize: Int,
        qrPixelSize: Int, neighbors: Neighbors
    ): Boolean = {
        val center = elementSize/2.0
        return (sqrt((center-i)*(center-i) + (center-j)*(center-j)) < center)
    }
}

GitHub

https://github.com/alexzhirkevich/custom-qr-generator
You might also like...

Generate Qr Code using ZXING with a logo if needed

QrGeneratorWithLogo Generate Qr Code using ZXING with a logo if needed Download the Helper file and use it 1- add zxing lib into your project implem

Mar 14, 2022

Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso. Even with gif and webp support! 🍻

Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso. Even with gif and webp support! 🍻

BigImageViewer Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling

Jun 15, 2022

Pixel Launcher Mods a root app for Android 12+ that enables you to add a number of features to the stock Pixel Launcher

Pixel Launcher Mods a root app for Android 12+ that enables you to add a number of features to the stock Pixel Launcher

A root app that enables you to add a number of features to the stock Pixel Launcher, without needing Xposed

Jun 17, 2022

Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone.

Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone.

####Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone. This application will scan throug

Jun 15, 2022

🖼 Supports loading profile images with segmented style, shapes, borders, indicators, and initials for Android.

🖼 Supports loading profile images with segmented style, shapes, borders, indicators, and initials for Android.

AvatarView AvatarView supports loading profile images with segmented style, borders, indicators, and initials for Android. Download Gradle Add the bel

Jun 12, 2022

VideoView that plays video only when :eyes: are open and :boy: is detected with various other features

VideoView that plays video only when :eyes: are open and :boy: is detected with various other features

LookAtMe VideoView that plays video only when 👀 are open and 👦 is detected with various other features GIF AndroidPub (Medium) Post You can read the

Jun 11, 2022

Group Messaging Chat (Discord Clone :eyes:) App Using Firebase Cloud-Firestore following MVVM Architecture

Group Messaging Chat (Discord Clone :eyes:) App Using Firebase Cloud-Firestore following MVVM Architecture

Nit Talk Nit Talk is a Group Chat Messaging (Discord Clone) App based on Modern Android Application tech-stacks and MVVM architecture. Techs Used 💻 K

Jun 11, 2022

Drawing App: A simple drawing application that allows the user to draw using a pencil or using shapes

Drawing App: A simple drawing application that allows the user to draw using a pencil or using shapes

Drawing-App Drawing app is a simple drawing application that allows the user to

Feb 9, 2022

Blinking-image-view - A variant of Android View that blinks only the source image (not the background)

Blinker View for Android What is this? Blinker View is an Android View that blinks a given drawable. Yes, it's that simple. Place it in your layout an

Jul 29, 2020

Android fillable progress view working with SVG paths. This is a nice option too if you want to create an interesting branding logo for your app. Based on the iOS project: https://github.com/poolqf/FillableLoaders

Android fillable progress view working with SVG paths. This is a nice option too if you want to create an interesting branding logo for your app. Based on the iOS project: https://github.com/poolqf/FillableLoaders

Android FillableLoaders Android Open Source library providing an interesting fillable progress view working with SVG paths. This is a nice option too

Jun 15, 2022

QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式

QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式

🏃 BGAQRCode-Android 🏃 目录 功能介绍 常见问题 效果图与示例 apk Gradle 依赖 布局文件 自定义属性说明 接口说明 关于我 功能介绍 根据之前公司的产品需求,参考 barcodescanner 改的,希望能帮助到有生成二维码、扫描二维码、识别图片二维码等需求的猿友

Jun 23, 2022

Realtime, Accurate Background Changer, Portrait Segmentation, Portrait Matting, Background Removal for Android

Realtime Background Changer on Camera Stream Realtime, Accurate Background Changer, Portrait Segmentation, Portrait Matting, Background Removal SDK fo

Jun 17, 2022

AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Jun 17, 2022

AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Jun 17, 2022

ZXing ("Zebra Crossing") barcode scanning library for Java, Android

ZXing (

Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enha

Jun 24, 2022

Barcode scanner library for Android, based on the ZXing decoder

ZXing Android Embedded Barcode scanning library for Android, using ZXing for decoding. The project is loosely based on the ZXing Android Barcode Scann

Jun 22, 2022

Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image selection.

Awesome Image Picker Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image sel

May 23, 2022

Extended CoordinatorLayout, that helps creating background galleries

Extended CoordinatorLayout, that helps creating background galleries

BlurZoomGallery Extended CoordinatorLayout, that helps creating background galleries. Features: expandable Collapsing Toolbar Layout, making space for

May 12, 2022

a simple QRCode generation api for java built on top ZXING

QRGen: a simple QRCode generation api for java built on top ZXING Please consider sponsoring the work on QRGen Dependencies: ZXING: http://code.google

Jun 15, 2022
QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式
QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式

?? BGAQRCode-Android ?? 目录 功能介绍 常见问题 效果图与示例 apk Gradle 依赖 布局文件 自定义属性说明 接口说明 关于我 功能介绍 根据之前公司的产品需求,参考 barcodescanner 改的,希望能帮助到有生成二维码、扫描二维码、识别图片二维码等需求的猿友

Jun 23, 2022
Barcode scanner library for Android, based on the ZXing decoder

ZXing Android Embedded Barcode scanning library for Android, using ZXing for decoding. The project is loosely based on the ZXing Android Barcode Scann

Jun 22, 2022
a simple QRCode generation api for java built on top ZXING

QRGen: a simple QRCode generation api for java built on top ZXING Please consider sponsoring the work on QRGen Dependencies: ZXING: http://code.google

Jun 15, 2022
ZATAC Scanner is Android Kotlin-based QR code scanner and parser which de-crypt TLV qr codes and parse them into their values.
ZATAC Scanner is Android Kotlin-based QR code scanner and parser which de-crypt TLV qr codes and parse them into their values.

ZATAC Scanner is Android Kotlin-based QR code scanner and parser which de-crypt TLV qr codes and parse them into their values.

Apr 23, 2022
Android app and Python library for turning mobile phone into a WebSocket-based, remotely controllable Barcode/QR code reader

Remote Barcode Reader suite Android app and Python library for turning mobile phone into a remotely controllable Barcode/QR code reader. It exposes a

Mar 24, 2022
A library to help implement barcode scanning
A library to help implement barcode scanning

A library to help implement barcode scanning

Jun 8, 2022
Barcode Scanner Libraries for Android
Barcode Scanner Libraries for Android

Project Archived July 1 2020 This project is no longer maintained. When I first started this project in late 2013 there were very few libraries to hel

Jun 21, 2022
Qart is Android App that's based on CuteR project. App generate QR code that merge a picture. So the QR code looks more beautiful.
Qart is Android App that's based on CuteR project. App generate QR code that merge a picture. So the QR code looks more beautiful.

Qart is Android App that's based on CuteR project. App generate QR code that merge a picture. So the QR code looks more beautiful.

Jun 13, 2022
An unofficial package to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing for Android Apps on smart phones and POS devices
An unofficial package to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing for Android Apps on smart phones and POS devices

Kotlin - ZATCA (Fatoora) QR-Code Implementation QR-Code implementation for the e-invoicing (Fatoora) Zatca-Fatoora Enter seller information Base64 and

Jun 14, 2022
QRAlarm - an Android alarm clock application lets the user turn off alarms by scanning the QR Code.
QRAlarm - an Android alarm clock application lets the user turn off alarms by scanning the QR Code.

QRAlarm is an Android alarm clock application that does not only wake You up, but also makes You get up to disable the alarm by scanning the QR Code.

Jun 15, 2022