QR Code Generator

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 32
At a glance
Powered by AI
The project discusses developing a QR code generator using Android Studio. It provides details about QR code technology and its growing applications.

The project is about developing a QR code generator application in Android Studio to allow users to generate QR codes by entering text in a web browser.

The project uses libqrencode C library to encode data into QR codes and a Drupal module for the user interface.

QR Code Generator

A Project Report

Submitted in partial fulfillment of the

Requirement for the award of the degree of

BACHELOR OF SCIENCE (COMPUTER SCIENCE)

By

Shivam Sharma

Under the esteemed guidance of

Miss. Supriya Kamble

(HOD)

DEPARTMENT OF SCIENCE (COMPUTER SCIENCE)

ST.WILFRED’S COLLEGE OF ARTS, COMMERCE AND SCIENCE.

(Affiliated to University of Mumbai)

PANVEL, 410206

MAHARSHTRA

2021-2022

1
ST.WILFRED’S COLLEGE OF ARTS, COMMERCE AND SCIENCE.

(Affiliated to University of Mumbai)

PANVEL – MAHARASHTRA -410206

DEPARTMENT OF SCIENCE (COMPUTER SCIENCE)

CERTIFICATE
This is certify that project entitled “QR Code Generator in Android studio”, is
bonafide work of
Shivam Sharma submitted in partial fulfillment of the requirement for the award of
degree of BACHELOR OF SCIENCE (COMPUTER SCIENCE) from university of
Mumbai.

Internal Coordinator Guide

External Examiner Principal

Date: College Seal

2
INDEX:

ACKNOWLEDGEMENT

Sr. No TITLE

1. INTRODUCTION

2. PROBLEM STATEMENT

3. EXISTING SYSTEM

4. PROPOSED SYSTEM

5. METHODOLOGY AND TECHNIQUES USED

6. DATA FLOW DIAGRAM

7. SYSTEM REQUIREMENTS

8. OBJECTIVES

9. SYSTEM CODE

10. OUTPUT

11. CONCLUSION

12. FUTURE SCOPE

13. REFERENCES

Apart from the efforts of myself, the success of any project depends largely on the

En-couragement and guidelines of many others. I take this opportunity to express my


gratitude

to the people who have been instrumental in the successful completion of this project. I

would like to show my greatest appreciation to Prof. Supriya Kamble for suggesting the

Project topic.

3
I can’t say thank you enough for tremendous support and help. Without her

En-couragement and guidance this project would not have materialized. The guidance and

support received from all the members who contributed and who are contributing to this

project was vital for the success of the project. I am grateful for their constant support and

help.

Special thanks to our Principal Sir Dr. Anirudha Rishi for giving us the opportunity

for developing such project,

I would like to thank all my teaching staff for helping me for successfully completion

of the project.

Lastly thanks to Microsoft Corporation for providing visual studio which made my

project possible

ABSTRACT

Quick Response (QR) codes seem to appear everywhere these days. We can see them
on posters, magazine ads, websites, product packaging and so on.
Using the QR codes is one of the most intriguing ways of digitally connecting
consumers to the internet via mobile phones since the mobile phones have become a basic
necessity thing of everyone.
In this paper, we present a methodology for creating QR codes by which the users
enter text into a web browser and get the QR code generated.
Drupal module was used in conjunction with the popular libqrencode C library to
develop user interface on the web browser and encode data in a QR Code symbol.

4
The experiment was conducted using single and multiple lines of text in both
Englishand Thai languages. The result shows that all QR encoding outputs were successfully
and correctly generated.

INTRODUCTION:

A QR code is a type of matrix bar code or two-dimensional code that can store data
information and designed to be read by smartphones. QR stands for “Quick Response”
indicating that the code contents should be decoded very quickly at high speed. The code
consists of black modules arranged in a square pattern on a white background. The
information encoded may be text, a URL or other data

The QR code was designed to allow its contents to be decoded at high speed. The
popularity of QR codes is growing rapidly all around the world. Nowadays, mobile phones
with built-in camera are widely used to recognize the QR Codes.

The QR code system was invented in 1994 by Masahiro Hara from the Japanese
company Denso Wave. The initial design was influenced by the black and white pieces on
a Go board.

5
QR Codes are created by the Toyota subsidiary Denso Wave in 1994, and was
initially used for tracking inventory in vehicle parts manufacturing.

The idea behind the development of the QR code is the limitation of the barcode
information capacity (can only hold 20 alphanumeric characters).

While they are developed for tracking parts in vehicle manufacturing, QR codes now
are used in many other fields, from commercial tracking to entertainment, in-store product
labeling, and in those applications that are aimed at smartphone users.

Users may open URL; receive text after scanning QR codes. By using QR code
generating sites or apps, users can generate and print their own QR codes for others to scan
and use.

The QR code system consists of a QR code encoder and decoder. The encoder is
responsible for encoding data and generation of the QR Code, while the decoder decodes the
data from the QR code

During the month of June 2011, 14 million American mobile users scanned a QR
code or a barcode. Some 58% of those users scanned a QR or barcode from their homes,
while 39% scanned from retail stores; 53% of the 14 million users were men between the
ages of 18 and 34.
A September 2020 survey found that 18.8 percent of consumers in the United States
and United Kingdom strongly agreed that they had noticed an increase of QR code use since
the begin of COVID-19 related shelter-in-place orders in March 2020.

Figure 1 shows the overview of the QR code working. The plain text, URL, or other
data are given to the QR code encoder, and it generates the required QR code and when we
want to access the data of the QR code, QR code is decoded via QR Code decoder (scanner)
which retrieves the data of QR code

6
PROBLEM STATEMENT:

QR Code usage is now on the rise more than ever. With contactless solutions being

leveraged for most operations, QR Codes are being used for contactless payment, contactless

delivery, and even contactless retail.

Smartphones today have the capability to scan even damaged QR Codes, but there are

possibilities a QR Code might not scan. 

There are mainly 6 reasons why a QR Code does not work: 

1. Bad quality

2. Inverted colors

3. Small size

4. Poor contrast ratio

5. Wrong Placement

7
6. Overcrowded QR Code

EXISTING SYSTEM:

#1. Beaconstac’s QR Code generator (9.8/10)


Beaconstac offers a free option on its website that allows you to create a custom QR
Code.
The website also has informative material to help you get started. However, if you are
evaluating it for a project/campaign and not one-time use, I’d encourage you to sign up for a
free trial to experience its potential.

8
Beaconstac’s QR Code generator

QR Codes created using this solution are flexible, which means it supports multiple
languages and you can change the content linked to it as and when required (dynamic).
While the dashboard provides analytics about the QR Codes, its Google Analytics
integration gives a sense of the users that scanned them. The solution has good reviews on G2
(4.8/5) and most users talk about its ease-of-use and vigilant customer support.
The platform supports enterprise brand needs with SSO login, age-gated redirects,
password protection, and custom domains. The solution also allows adding multiple users and
managing their access.
Since the use-case is downloading a QR Code for product packaging, I found I was
able to download high-quality QR Codes in SVG and EPS format.
Free-QR-code.net, another QR Code generator is now acquired by Beaconstac.
Paid Plans: Beaconstac’s QR Code solution starts off at $5/month billed annually and
also has enterprise-ready options. To learn about the Enterprise plan, you can schedule a call
with a live expert or call the sales line.

PROPOSED SYSTEM:

What does a QR code generator do?


A free QR code generator online encodes information into a QR code. Often that
means turning a link into a QR code.
You upload information onto the website, and the website spits out a QR code. That
QR code links out to a URL, a PDF, or the other information you uploaded.

In this project we can generate qr code of names , numbers and url.


we can also scan the qr code with specific scanner for qr code generated by text or etc,

9
METHODOLOGY AND TECHNIQUES USED:

The methodology and techniques used here for making QR Code Generator is by
using Android Studio and Flatcon.

ANDROID STUDIO:-

Android Studio is the official integrated development environment (IDE)


for Google's Android operating system, built on JetBrains' IntelliJ IDEA software and
designed specifically for Android development. It is available for download
on Windows, macOS and Linux based operating systems or as a subscription-based service in
2020. It is a replacement for the Eclipse Android Development Tools (E-ADT) as the primary
IDE for native Android application development.
Android Studio was announced on May 16, 2013 at the Google I/O conference. It was
in early access preview stage starting from version 0.1 in May 2013, then entered beta stage
starting from version 0.8 which was released in June 2014. The first stable build was released
in December 2014, starting from version 1.0.
Android Studio supports all the same programming languages of IntelliJ (and CLion)
e.g. Java, C++, and more with extensions, such as Go and Android Studio 3.0 or later
supports Kotlin and "all Java 7 language features and a subset of Java 8 language features

10
that vary by platform version." External projects backport some Java 9 features. While
IntelliJ states that Android Studio supports all released Java versions, and Java 12, it's not
clear to what level Android Studio supports Java versions up to Java 12 (the documentation
mentions partial Java 8 support). At least some new language features up to Java 12 are
usable in Android.

A specific feature of the Android Studio is an absence of the possibility to switch


autosave feature off.
The following features are provided in the current stable version

 Gradle-based build support


 Android-specific refactoring and quick fixes
 Lint tools to catch performance, usability, version compatibility and other problems
 ProGuard integration and app-signing capabilities
 Template-based wizards to create common Android designs and components
 A rich layout editor that allows users to drag-and-drop UI components, option
to preview layouts on multiple screen configurations
 Support for building Android Wear apps
 Built-in support for Google Cloud Platform, enabling integration with Firebase Cloud
Messaging (Earlier 'Google Cloud Messaging') and Google App Engine[19]
 Android Virtual Device (Emulator) to run and debug apps in the Android studio

Flatcon:-

Flaticon is the largest free database of editable icons 1 with more than 2.5 million
available resources. It is a freemium platform, this means that it has a free version (in which
users must attribute) and a paid version where it offers Premium content with no download

11
limit. 

Flaticon was created in 2013 by the brothers Alejandro Sánchez and Pablo Blanes
together with Joaquín Cuenca,  and is part of the Malaga company Freepik Company, which
includes 3 other products: Slidesgo, Freepik  and Storyset. 

In 2020 there was a redesign of the brand carried out by the company's own designers. In
addition, that same year, during the first wave of Covid-19 and the total confinement , free
Flaticon accounts were enabled for health, education, media and public agency workers to
help them continue developing their work. 
Flaticon offers graphic content selected by the company's team, it is possible to search for
icons easily through the search engine and using the corresponding filters. It is a tool mainly
used by designers and developers. 
The online platform allows the download of the icons in different formats: PNG, SVG
and EPS. Regarding the size of the vectors, you can choose between seven different
dimensions: 16, 24, 32, 64, 128, 256 and 512 pixels are the options.  In addition, these icons
can be in black and white, in different colors or in a flat style.

12
Flaticon has an icon editor within the platform, this function allows you to edit the
size, position or colors to create the icon that best suits each project. 
In 2020, the free Flaticon editor added improvements such as the ability to add
geometric-shaped backgrounds (which can also be colored) to icons. This improvement
facilitates the use of the tool from any device

13
There are several ways in which an application can be made using numerous
programming languages such as

• PHP
• ASP.NET
• Java
• Ruby
• Static files
• Scala
• Python
• Erlang
• Kotlin

14
15
DATA-FLOW DIAGRAM:

The flow of data of a system or a process is represented by DFD. It also gives insight
into the inputs and outputs of each entity and the process itself. DFD does not have control
flow and no loops or decision rules are present. Specific operations depending on the type of
data can be explained by a flowchart. Data Flow Diagram can be represented in several ways.
The DFD belongs to structured-analysis modeling tools. Data Flow diagrams are very
popular because they help us to visualize the major steps and data involved in software-
system processes.

16
SYSTEM REQUIREMENTS:

SOFTWARE REQUIREMENTS:-
 java se development kit
 android-studio-2020.3.1.24-windows
 flatcon

HARDWARE REQUIREMENTS:-

For running java JDK


 2 GHz CPU or 1 virtual CPU in virtualized environments.
 1 GB of RAM.
 4 GB of storage.

For running android studio

 4GB RAM minimum (3GB for the Android Studio and 1GB for the Android
Emulator), 8GB recommended
 2GB disk space minimum, 4GB Recommended
 1280 x 800 minimum screen resolution

17
OBJECTIVES:-

Over the years, a wider mobile network coverage coupled with an increase in
smartphone web content has created the perfect conditions for the return of the QR Code.
Coupled with the integration of a Code reader in the latest iPhone and Samsung phones, they
have become much more accessible, eliminating several inconvenient steps, and granting
quicker access to valuable information that gives more transparency. Beyond that, the advent
of the branded QR Code means they offer a more meaningful connection to brands and
products through design.
Plenty in terms of optimizing your marketing campaign. With QR Codes, you have
the flexibility of adding more content, in different formats, without compromising the design
of your packaging, disrupting your brand identity, overloading your audience with text, or
overspending on printing.

18
SYSTEM CODE-:

Java Code:-

package com.example.qrcodesanner;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.textfield.TextInputEditText;
import com.google.zxing.WriterException;

import androidmads.library.qrgenearator.QRGContents;
import androidmads.library.qrgenearator.QRGEncoder;

public class GenerateQRCodeActivity extends AppCompatActivity {

private TextView qrCodeTV;


private ImageView qrCodeIV;
private TextInputEditText dataEdit;
private Button generateQRBtn;

19
private QRGEncoder qrgEncoder;
private Bitmap bitmap;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_generate_qrcode);
qrCodeTV = findViewById(R.id.idTVGenerateQR);
qrCodeIV = findViewById(R.id.idIVQRCode);
dataEdit = findViewById(R.id.idEDtData);
generateQRBtn = findViewById(R.id.idBtnGenerateQR);
generateQRBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String data = dataEdit.getText().toString();
if (data.isEmpty()){
Toast.makeText(GenerateQRCodeActivity.this, "Please enter some data to
generate QR Code..", Toast.LENGTH_SHORT).show();
}else {
WindowManager manager = (WindowManager)
getSystemService(WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
Point point =new Point();
display.getSize(point);
int width = point.x;
int height = point.y;
int dimen = width<height ? width:height;
dimen = dimen * 3/4;

20
qrgEncoder = new
QRGEncoder(dataEdit.getText().toString(),null,QRGContents.Type.TEXT,dimen);
try {
bitmap = qrgEncoder.encodeAsBitmap();
qrCodeTV.setVisibility(View.GONE);
qrCodeIV.setImageBitmap(bitmap);
}catch (WriterException e){
e.printStackTrace();
}

}
}
});

}
}

21
XML Code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_shade_1"
style="@style/AppTheme.MaterialTheme"
tools:context=".GenerateQRCodeActivity">

<FrameLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/idFLQrCode"
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="1dp"
android:padding="4dp"
android:text="Your Code will appear here"
android:textAlignment="center"
android:textAllCaps="false"
android:id="@+id/idTVGenerateQR"

22
android:textColor="@color/black"
android:textSize="15sp" />

<ImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:background="@color/white"
android:id="@+id/idIVQRCode"
/>
</FrameLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/idFLQrCode"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginLeft="15dp"
android:id="@+id/idTILData"
android:layout_marginTop="20dp"
android:layout_marginRight="15dp"
android:hint="Add text to embed in QR Code"
android:padding="5dp"
android:textColorHint="@color/white"
app:hintTextColor="@color/white"
>

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/idEDtData"

23
android:ems="10"
android:importantForAutofill="no"
android:inputType="textImeMultiLine|textMultiLine"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:textSize="14sp"
/>

</com.google.android.material.textfield.TextInputLayout>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/idTILData"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_back"
android:text="Generate QR Code"
android:textAllCaps="false"
android:id="@+id/idBtnGenerateQR"

/>

</RelativeLayout>

24
OUTPUT:-

25
26
27
28
CONCLUSION:-

QR code is now being widely used in a variety of businesses. QR code is a way of


encoding more information than a traditional bar code. And most importantly, it contains
information that can be easily decoded at high speed.
In this paper, we show how to create the QR codes via the web browser that facilitates
users to easily create their own QR codes for websites, emails, business cards, print ads and
so on.
The proposed method was developed using entirely open source software such as
Libqrencode, Drupal and Ubuntu.
The experimental results show that the QR codes were successfully and correctly
generated. Therefore, the proposed method is considerably a QR code generator collaborative
tools that is available for free use
We studied QR code technology, its benefits, application areas, and its impact on
marketing and technological world. Initially, QR code are developed and use for inventory
tracking stuff but, now these days, they found applications in many new areas like marketing,
advertising, secure payment systems, education industries, etc.
Adoption of the QR codes grows rapidly during past years and number of users
increases exponentially, due to its features like high data storage capacity, fast scanning,
error-correction, direct marking and ease of use.

29
FUTURE SCOPE:-

The wave of innovation and technology that has invaded the world has brought with it
myriad benefits. The biggest and most important benefit of technology has been that it has
brought the world closer and has enabled people and businesses to foster multidimensional
relationships in a seamless and efficient manner.

The true value of technology can only be harnessed if it is interoperable or easy to


harmonise across providers and users. Simply put, it is the ability of different systems to
operate seamlessly. Interoperability is an industry buzzword that is slowly gaining a lot of
popularity in the current ecosystem – especially when it comes to QR codes. The ability to
standardise a QR-based system offers myriad benefits to all the stakeholders in the
ecosystem, enabling a more seamless experience for both the transacting parties. Recognising
this potential value, in September 2016, India launched Bharat QR, which it called the
world’s first fully interoperable QR code payments. Developed by the National Payments
Corporation of India (NPCI) together with MasterCard and Visa, Bharat QR overcomes the
limitations of closed loop QR code-based acceptance.

  In future, their scope could be expanded to include a wide variety of banking


transactions and engagements. For instance, ‘Touchless’ or ‘Contactless’ ATM withdrawals
using QR codes are now gaining popularity as it minimises the risk of spread of virus and
also makes transactions faster & more secure.

30
REFERENCE:-

[1] Yue Liu, Ju Yang, Mingjun Liu, “Recognition of QR Code with mobile
,” Control and Decision Conference, CCDC 2008. Chinese, pp. 203 - 206,
2-4 July 2008.

[2] Yu-Hsuan Chang, Chung-Hua Chu and Ming-Syan Chen, “A General


Scheme for Extracting QR Code from a Non-uniform Background in
Camera Phones and Applications,” Ninth IEEE International Symposium
on Multimedia, ISM 2007. pp. 123-130, 10- 12 Dec. 2007

[3] Aidong Sun, Yan Sun and Caixing Liu, “The QR-code reorganization
in illegible snapshots taken by mobile phones,” International
Conference on Computational Science and its Applications, 2007. ICCSA
2007, pp. 532-538, 26-29 Aug. 2007

[4] ScanLife.com, “QR Code Adoption: Trends and Statistics”,www.scanlife.com

[5] Y. Yan, H.W. Liu, “Research and Application of Encoding and Decoding Tech. of
QR Code”, University of Science and Tech, Beijing
[6]. https://github.com/chen0040/keras-QR-code-web-api.git

[7]. https://github.com/hkaraoglu/language-QRcode.git

[8]. https://github.com/basemax/toyqrcode.git

[9]. https://github.com/stackery/qr-code.git

[10]. https://github.com/tarun-kamboj/QR-code_webapp.git

[11]. https://github.com/pranshu04/QRcode.git

[12]. https://github.com/watson-developer-cloud/QRcode-tooling.git

13. https://github.com/chhotu05/QRcode.git

14. https://github.com/jafirdon/speech-to-QRCode.git

15. https://github.com/ribeiromatheus/QRcode.git

31
32

You might also like