VOOZH about

URL: https://www.geeksforgeeks.org/android/how-to-build-a-qr-code-android-app-using-firebase/

⇱ How to Build a QR Code Android App using Firebase? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Build a QR Code Android App using Firebase?

Last Updated : 23 Jul, 2025

QR (Quick Response) code is a type of two-dimensional barcode that contains information encoded in a pattern of black and white squares. It was first developed in 1994 by a company named Denso Wave. Qr codes can be scanned by a smartphone or a dedicated QR code scanner, which uses the device's camera to read the code and extract the information stored within it. This can include text, URLs, contact information, and more, depending on what the QR code has been programmed to contain. A sample video is given below to get an idea about what we are going to do in this article.

Note: This Android article covered in both Java and Kotlin languages. 

QR Scanner

A QR Scanner is a tool that can read and decode QR codes. QR code scanners are widely available as mobile apps that can be downloaded on smartphones and tablets and can be used to scan QR codes using the device's built-in camera. Our QR code scanner app also includes additional features, such as the ability to generate QR codes and share information with others.

Step-by-Step Implementation

Step 1: Create a New Project in Android Studio

To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select Java as the programming language.

Step 2:

Create two floating buttons, one for scanning the code and the other for generating the QR code.

QR Generator Code:

QR Scanner Code:

Output UI:

👁 Image
 

Step 3:

Add a gradient to your background.

Step 4:

In your activity main xml file add one CardView, one ImageView, two floating action buttons, and one EditText.

👁 Image
 

Step 5:

In your main activity add this code, and create two onclick Listeners for generating and scanning the QR code.

Step 6: 

Create a new Empty activity in your project. Add this code to your Java folder. 

Step 7:

Add these dependencies in your gradle file.

implementation 'me.dm7.barcodescanner:zxing:1.9.13'
implementation 'com.karumi:dexter:6.2.2'
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
👁 Image

Step 8:

Add these styles to your themes.xml.

👁 Image

Note: Make sure your project connects your project with Firebase before running on any device or emulator.

Output:

Comment

Explore