You are on page 1of 22

MAHARASHTRA STATE BOARD OF TECHNICAL

EDUCATION
GOVERNMENT POLYTECHNIC MURTIZAPUR
2023-2024

Department of Information Technology


MICRO PROJECT TOPIC:-

“Qr Code Scanner & Generator Application”

SUBJECT :- MOBILE APPLICATION DEVELOPMENT (22617)

GUIDED BY:- Prof R. R. Bhoge

SUBMITTED BY-

ROLL NO NAME ENROLLMENT


NO
17 Pankaj N. Gorle 2112410146

36 Pratik P. Thorat 2112410181

53 Shivam E. Khadse 2112410153

1
Maharashtra State
Board of Technical Education
Certificate
This is to certify the following group of students roll …………………………. of 6th
semester of Diploma in Information Technology of institute, Government Polytechnic
Murtizapur (CODE: - 1241) has completed the Micro Project satisfactorily in the
subject – Mobile Application Development (22617) for the Academic year 2023 to 2024 as
prescribed in the Curriculum.

Place: Murtizapur Enrolment No.:

Date:_ Seat No.:

Course Teacher Head of the Department Principal

2
INDEX

SR.NO TOPIC PAGE.NO

1 Cover Page 1

2 Certificate 2
3 Index 3
4 Acknowlegement 4

5 Introduction 5

6 Application 6

7 Aims/ Course outcome/ methodologies 07 to 10

8 Action Plan 11

9 Coding 12 to 20

10 Output 21

11 Conclusion 22

3
ka

ACKNOWLEDGEMENT

It gives me immense pleasure bringing out this project entitled “QR Code
scanner & generator application in the guidance of Mr. R. R. Bhoge, I would
like to thank my guide for helpful suggestion & numerous discussions at all
stages of this project.

I am also thankful to Name of HOD, Hon’ble Head of the Department for


proving me requisite platform for the work of my project.

I am also thankful to name of principal Sir, Hon’ble Principal,


Government Polytechnic Murtizapur for providing me helpful facilities
during my project work.
Last but not least, I am thankful to all staff members of Information
Technology Department and my friends for their valuable guidance and
suggestion during the work of my project.

Thanking You……

4
INTRODUCTION :

The widespread adoption of smartphones has led to an increased use of QR codes


in a variety of applications. QR codes offer a fast and convenient way to store and
access information, making them a versatile tool for marketing, inventory
management, and event management, among other applications.

As a micro project, I have created a QR code application that can both scan and
generate QR codes using the ZXing library in an Android application.

The main goal of this QR code application is to provide a simple and efficient way
for users to scan and generate QR codes. The application features a user-friendly
interface that allows users to easily scan destroy

5
Applications
QR code scanners have a wide range of applications in various industries. For
example, in retail, QR codes can be used to provide product information, enable
mobile payments, or offer discounts or coupons. In healthcare, QR codes can be
used to store patient data, track inventory, or provide instructions for medical
devices.

In transportation, QR codes can be used to store ticket information, provide access


to travel information, or enable mobile check-ins. QR codes are especially useful
in situations where space is limited, such as on products or signage, and where it
may be inconvenient to type in long strings of data manually. They also offer a level
of security by allowing encrypted data to be stored in the code

QR code generators can be used to create QR codes for a variety of purposes. For
example, in marketing, QR codes can be used to promote products or services,
enable social media sharing, or provide links to landing pages.

In education, QR codes can be used to provide additional resources or enable


interactive learning experiences. QR code generators can be used to create custom
codes with various designs, colors, and logos, making them a versatile tool for
branding and promotion.

6
QR CODE SCANNER & GENERATOR
APPLICATION
Aims/Benefits of the Micro-Project

• Convenience: With a QR scanner app on their phone, users can quickly and
easily scan QR codes to access information, without the need for typing in
long URLs or searching for information manually.

• Increased Efficiency: QR codes can be used to provide information quickly,


such as product information, website links, contact information, and more.
By using a QR scanner app, users can quickly access this information,
saving them time and increasing their efficiency.

• Better Security: QR codes can be used to securely transfer information,


such as payment information or login credentials. By using a QR scanner
app, users can ensure that the information they are accessing is authentic
and secure.

• Cost-Effective: Creating and distributing QR codes is a cost-effective way


for businesses to provide information to their customers. By using a QR
generator app, users can easily create their own QR codes without the need
for expensive software or hardware.

Course Outcomes Addressed


The creation of a simple QR scanner and QR generator app using Android Studio and Zing library
addresses the following course outcomes:

1. Mobile Application Development: Creating a mobile app using Android Studio and Zing
library demonstrates the ability to develop mobile applications.

7
2. User Interface Design: Designing a user-friendly interface for the QR scanner and QR
generator app shows the ability to create a visually appealing and user-friendly interface for
mobile applications.

3. CoData Storage and Retrieval: The app uses ZXing library to retrieve and store data,
demonstrating the ability to integrate external libraries and APIs in mobile app development.

4. Problem-Solving Skills: Creating a functional QR scanner and QR generator app requires


problem-solving skills, including identifying and resolving errors in the code, debugging, and
testing.

Proposed Methodology :

The proposed methodology for creating a simple QR scanner and QR generator app using
Android Studio and Zing library involves the following steps:

1. Requirement Gathering: The first step is to gather requirements for the app, including
what features it should have, what platforms it should support, and what functionality it should
provide.

2. Design: Once the requirements are gathered, the next step is to design the user interface
for the app. This involves creating wireframes and mockups to visualize the app's layout and
user flow.

3. Development: With the design in place, the next step is to begin the development process.
This involves writing the code to implement the app's functionality, including using Zing
library to integrate QR scanning and generation.

4. Testing: After the app is developed, the next step is to test it thoroughly to ensure that it
is free from bugs and performs as expected. This involves running tests on various devices,
platforms, and networks to ensure that the app functions correctly in different scenarios.

RELATIONAL:
The rationale behind developing a simple QR scanner and QR generator app using Android
Studio and Zxing library is to provide users with a convenient way to scan and generate QR
8
codes. QR codes have become increasingly popular in recent years, and they are used in various
domains, including marketing, logistics, and education. With the growing popularity of QR
codes, there is a need for an app that can scan and generate QR codes.

Developing an app for scanning and generating QR codes using Android Studio and Zxing library
offers several advantages, including:

1. Convenience: The app provides users with a convenient way to scan and generate QR codes
using their mobile devices.
2. Efficiency: The app is designed to be efficient and fast, allowing users to scan and generate
QR codes quickly.
3. Cost-Effective: Developing an app for scanning and generating QR codes is cost- effective
compared to purchasing a separate QR code scanner or generator.
4. Customization: Developing an app allows for customization of the user interface, features,
and functionality, providing a unique user experience.
5. Learning Opportunities: Developing an app provides opportunities for learning new skills
related to mobile app development, programming, user interface design, integration,
problemsolving, and project management.

Overall, developing a simple QR scanner and QR generator app using Android Studio and Zxing
library is a rational decision because it offers a convenient, efficient, cost- effective, customizable
solution for scanning and generating QR codes, while also providing opportunities for learning
and skill development.

9
⁰Page 10 of 17

Methodology Followed :
The actual methodology followed for developing a simple QR scanner and QR generator app
using Android Studio and Zxing library involves the following steps:

1. Installing Android Studio: The first step is to install Android Studio, which is an integrated
development environment (IDE) used for developing Android apps.

2. Creating a new project: The second step is to create a new project in Android Studio by
selecting the appropriate settings, including the package name, SDK version, and project type.

3. Adding dependencies: The next step is to add the required dependencies, including the
Zxing library, which is used for scanning and generating QR codes.

4. Designing the user interface: The next step is to design the user interface for the app using
Android's XML layout files. The user interface should be user-friendly and easy to navigate.

5. Writing the code: The next step is to write the code for the app, including the code for
scanning and generating QR codes. The code should be optimized for performance and should
follow best coding practices.

6. Testing the app: The next step is to test the app thoroughly to ensure that it is working as
expected. The app should be tested on various devices and operating systems to ensure
compatibility.

The above steps provide a high-level overview of the actual methodology followed for
developing a simple QR scanner and QR generator app using Android Studio and Zxing
library. However, the actual process can be more detailed and may involve additional steps
depending on the complexity of the app and the project requirement.

10
⁰Page 11 of 17

Action plan
S.NO. Details Of Activity Planned Start Planned Finish Name Of
Date Date Responsible Team
Members

1 Discussion and 1/1/24 4/1/24 All members


finalization of topic

2 Preparation and 7/1/24 15/1/24 Pankaj Gorle


submission of
abstract Pratik Throat

Shivam Khadse
3 Collection of data 17/1/24 25/1/24 Pankaj Gorle

Pratik Throat

Shivam Khadse
4 Preparing Algorithm 28/1/24 4/2/24 Pankaj Gorle
and Flowchart
Pratik Throat

Shivam Khadse
5 Development of 5/2/24 9/2/24 Pankaj Gorle
program
Pratik Throat

Shivam Khadse
6 Development o 12/3/24 18/3/24 Pankaj Gorle
program
Pratik Throat

Shivam Khadse
7 Presentation/Seminar 25/3/24 1/4/24 Pankaj Gorle

Pratik Throat

Shivam Khadse
8 Submission Micro- 2/4/24 6/4/24 Pankaj Gorle
Project
Pratik Throat

Shivam Khadse

11
⁰Page 12 of 17

Resource Required

S.NO. Name of resource/material


1 Operating System (Windows 11)
2 Software- Android Studio

3 Android Device

Coding :

GenerateQRCodeActivity.java
package com.example.qr_code_generatorscanner;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.hardware.input.InputManager;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

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

12
⁰Page 13 of 17

import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.journeyapps.barcodescanner.BarcodeEncoder;

public class GenerateQRCodeActivity extends AppCompatActivity {

private TextView qrCodeTextView;


private ImageView qrCodeImageView;
private TextInputEditText qrCodeTextInputEditText;
private Button qrCodeGeneratorButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_generate_qrcode);
qrCodeTextView = findViewById(R.id.frameText);
qrCodeImageView = findViewById(R.id.QRCodeImg);
qrCodeTextInputEditText = findViewById(R.id.inputData);
qrCodeGeneratorButton = findViewById(R.id.QRCodeGeneratorBtn);

qrCodeGeneratorButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String data = qrCodeTextInputEditText.getText().toString().trim();
if(data.isEmpty()){
Toast.makeText(GenerateQRCodeActivity.this, "Please Enter Some Data to
Generate QR Code", Toast.LENGTH_SHORT).show();
}else{

13
⁰Page 14 of 17

// Initialize multi format writer


MultiFormatWriter writer = new MultiFormatWriter();

// Initialize bit matrix


try {
BitMatrix matrix = writer.encode(data, BarcodeFormat.QR_CODE, 250, 250);

// Initialize barcode encoder


BarcodeEncoder encoder = new BarcodeEncoder();

// Initialize Bitmap
Bitmap bitmap = encoder.createBitmap(matrix);

//set bitmap on image view


qrCodeImageView.setImageBitmap(bitmap);

// Initialize input manager


InputMethodManager manager1 = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);

//Hide soft Keyboard

manager1.hideSoftInputFromWindow(qrCodeTextInputEditText.getApplicationWindowToken()
,0);

qrCodeTextView.setVisibility(View.GONE);

} catch (WriterException e) {
e.printStackTrace()

14
⁰Page 15 of 17

}
}
}); }}

HomeActivity.java
package com.example.qr_code_generatorscanner;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class HomeActivity extends AppCompatActivity {

private Button generateQRButton;


private Button scanQRButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);

generateQRButton = findViewById(R.id.QRCodeGeneratorBtn);
scanQRButton = findViewById(R.id.QRCodeScannerBtn);

generateQRButton.setOnClickListener(new View.OnClickListener() {
@Override

15
⁰Page 16 of 17

public void onClick(View view) {


Intent intent = new Intent(HomeActivity.this, GenerateQRCodeActivity.class);
startActivity(intent);
} });

scanQRButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(HomeActivity.this, ScanQRCodeActivity.class);
startActivity(intent);
}
}); }}

MainActivity.java
package com.example.qr_code_generatorscanner;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;

public class MainActivity extends AppCompatActivity {

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)

16
⁰Page 17 of 17

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManag
er.LayoutParams.FLAG_FULLSCREEN);

setContentView(R.layout.activity_main);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(MainActivity.this, HomeActivity.class);
startActivity(intent);
finish();
}
},2000); }}

ScanQRcodeActivity.java
package com.example.qr_code_generatorscanner;

import static android.Manifest.permission.CAMERA;


import static android.Manifest.permission.VIBRATE;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import android.app.Activity;
import android.content.pm.PackageManager;

17
⁰Page 18 of 17

import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import eu.livotov.labs.android.camview.ScannerLiveView;
import eu.livotov.labs.android.camview.scanner.decoder.zxing.ZXDecoder;

public class ScanQRCodeActivity extends AppCompatActivity {

private ScannerLiveView scannerLiveView;


private TextView scannedTextView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scan_qrcode);

scannerLiveView = findViewById(R.id.camView);
scannedTextView = findViewById(R.id.scannedData);

if(checkPermission()){
Toast.makeText(this, "Permission Granted..",Toast.LENGTH_SHORT).show();
}else{
requestPermission();
}

scannerLiveView.setScannerViewEventListener(new
ScannerLiveView.ScannerViewEventListener() {
@Override
public void onScannerStarted(ScannerLiveView scanner) {

18
⁰Page 19 of 17

Toast.makeText(ScanQRCodeActivity.this, "Scanner Started...",


Toast.LENGTH_SHORT).show();
}

@Override
public void onScannerStopped(ScannerLiveView scanner) {
Toast.makeText(ScanQRCodeActivity.this, "Scanner Stopped...",
Toast.LENGTH_SHORT).show();
}

@Override
public void onScannerError(Throwable err) {
Toast.makeText(ScanQRCodeActivity.this, "Scanner Error Occurred Please Start
Again...", Toast.LENGTH_SHORT).show();
}

@Override
public void onCodeScanned(String data) {
scannedTextView.setText(data);
}
});

private boolean checkPermission(){


int cameraPermission =
ContextCompat.checkSelfPermission(getApplicationContext(),CAMERA);
int vibratePermission =
ContextCompat.checkSelfPermission(getApplicationContext(),VIBRATE);

19
⁰Page 20 of 17

return cameraPermission == PackageManager.PERMISSION_GRANTED &&


vibratePermission == PackageManager.PERMISSION_GRANTED;
}

private void requestPermission(){


int PERMISSION_CODE = 200;
ActivityCompat.requestPermissions(this,new
String[]{CAMERA,VIBRATE},PERMISSION_CODE);
}

@Override
protected void onPause() {
scannerLiveView.stopScanner();
super.onPause();
}

@Override
protected void onResume() {
super.onResume();
ZXDecoder decoder = new ZXDecoder();
decoder.setScanAreaPercent(0.8);
scannerLiveView.setDecoder(decoder);
scannerLiveView.startScanner();
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if(grantResults.length > 0){

20
⁰Page 21 of 17

boolean cameraAccepted = grantResults[0] ==


PackageManager.PERMISSION_GRANTED;
boolean vibrationAccepted = grantResults[1] ==
PackageManager.PERMISSION_GRANTED;
if(cameraAccepted && vibrationAccepted){
Toast.makeText(this, "Permission Granted...", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(this, "Permission Denied \n You can't use the app without
permissions", Toast.LENGTH_SHORT).show();
}
} }}

Output :

21
⁰Page 22 of 17

Conclusion :

The QR code scanner and generator app offers users a convenient and versatile tool for accessing
and sharing information efficiently. By seamlessly scanning QR codes, users can quickly access
websites, product details, and other digital content, enhancing their overall digital experience.
Additionally, the app's QR code generation feature empowers users to create customized codes for
various purposes, such as marketing campaigns, event promotions, and personal branding. Overall,
the app simplifies the process of interacting with QR codes, making it an essential tool for both
personal and professional use in today's digital landscape

22

You might also like