QR Code Generator
QR Code Generator
QR Code Generator
A Project Report
By
Shivam Sharma
(HOD)
PANVEL, 410206
MAHARSHTRA
2021-2022
1
ST.WILFRED’S COLLEGE OF ARTS, COMMERCE AND 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.
2
INDEX:
ACKNOWLEDGEMENT
Sr. No TITLE
1. INTRODUCTION
2. PROBLEM STATEMENT
3. EXISTING SYSTEM
4. PROPOSED SYSTEM
7. SYSTEM REQUIREMENTS
8. OBJECTIVES
9. SYSTEM CODE
10. OUTPUT
11. CONCLUSION
13. REFERENCES
Apart from the efforts of myself, the success of any project depends largely on the
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
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
Smartphones today have the capability to scan even damaged QR Codes, but there are
1. Bad quality
2. Inverted colors
3. Small size
5. Wrong Placement
7
6. Overcrowded QR Code
EXISTING SYSTEM:
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:
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:-
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.
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:-
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;
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:-
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.
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.
[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
[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