‫Hello, my friends, in this video, we are going to continue with the exciting Firebase tutorials.
‫So we are going to create a QR code scanner app that uses the MLK device provided by Android Google
‫Firebase.
‫Okay, so what we will make is a barcode scanner application.
‫I will open Android studio, I will click on New Project here.
‫There is some additions for the latest updates of the Android studio chipmunk.
‫I will create empty activity.
‫I will name the application as Q are scanner.
‫Package name, save location and I will use the Java language and API minimum 21.
‫I click on finish and it will start creating the application after it.
‫Download the latest SDK.
‫If you download it, don't wait.
‫You will get the application and the Android studio project will be built instantly.
‫After that Android studio will open and it will start building their gradle.
‫So it download the latest versions of Gradle.
‫The Chipmunk is a is the latest version and update of Android studio recording of this video.
‫So I personally I prefer to always download the latest versions of Android Studio and always download
‫the latest as the case because some errors, some bugs will be fixed in Android studio and then next
‫updates and then later versions.
‫So we will wait for the Gradle.
‫So after completing the Gradle processes, we close this.
‫And here we go.
‫We are ready now to add the dependencies for our project and start a code.
‫So we open gradle and we are going to add the dependencies here for the camera x and the library QR
‫code from the ML kit.
‫So what are these libraries?
‫Let's go to.
‫Developers dot google dot com slash market slash vision slash barcode scanning.
‫So this library is is a part from the ML kit.
‫So with ML kits barcode scanning API, you can read data encoded using most standard barcode formats.
‫The barcode scanning helps on the device and does not require a network connection.
‫So we select Android.
‫And here are the features that they can be implemented.
‫There are two ways to integrate barcode scanning, either by bundling as a mobile, as a part of your
‫app, or using an unbundled model that depends on Google Play services.
‫So we are going to see the models later on in this application.
‫So we are going to add the dependencies for either building the model within your app or using the model
‫in Google Play Services.
‫Google Play Services is lighter, which is around 600 kilobytes for the library where where the bundling
‫with the model, it's about three megabytes.
‫So if you prefer adding and launching the app with instant instantaneously using the the model for for
‫scanning.
‫So you need to use this.
‫And if you have a model in Google Play Services, you need to download the model in Google Play Services.
‫We will see this later on.
‫I prefer adding this for the Google Play Services and this.
‫So we will see the two models here.
‫I will copy first of all, this that will be bundled inside the app without using the Google play services.
‫This is for bar code scanning with out Google Play Services.
‫I will click on sync now and we are ready to use this dependency.
‫Now if you choose to use the MO model in Google Play Services, which is here, if you implement this,
‫you can configure your app to automatically download the model to the device after your app is installed
‫from the play store.
‫So I prefer if you add this line, you need to add this inside the your manifest.
‫I will show you.
‫If I add this, I will add it.
‫I will add it using using Google just for demonstration.
‫Okay, guys.
‫If we add this, remember, if we add this and click on sync, now we are ready to use the barcode scanning.
‫If I use this, I need to add this line or this line's inside the manifest in order to allow the application
‫to download automatically the modal to the device after your app is installed from the play store.
‫So I will go to the manifest here.
‫This is the manifest and inside the application here is the application tags.
‫Inside the application between these application tags, I need to insert the modal here.
‫These are the metadata.
‫Okay.
‫To use multiple models, you can add the barcode to model to model three.
‫But till now we are we are ready to use this with the Android, with the Google play services.
‫So there are two ways.
‫Again, guys, I will recap.
‫There are two ways to add the dependency for the barcode scanning, either by adding it as a bundled
‫it is embedded with your app, but your app will be having an extra three megabyte in size.
‫If you care about the size of your application, you can use this modeling with the Google play services
‫and you should add the Android manifest this metadata metadata and you are ready to download it this
‫model when the user download it from the play store, so it will download the model with it.
‫So now this is the first way and this is the second way.
‫We click on Sync now and we save the project.
‫The second library that I'm going to use in our project is called Camera X.
‫It's from the developer dot android dot com slash training slash camera x and you will get this page.
‫So camera x here.
‫It's a jetpack library.
‫We have learned about the jetpack library in in the at the complete Android Jetpack course and the complete
‫Android developer courses.
‫And now we will continue with this jetpack library.
‫So we will it allows us to build a camera app development app app easier.
‫So it allows us to use the camera in app development more easier for new apps.
‫We recommend starting with Android.
‫With Camera X, it provides a consistent easy to use API that works across a vast majority of Android
‫devices.
‫So how to integrate this?
‫I will click on Get Started with a camera x and these are some.
‫Things OC.
‫I will add this dependency.
‫So I will copy these dependencies.
‫I will go to our gradle.
‫I will paste here the camera x, camera x, I will paste it and here we will click on sync now.
‫After the sync have been finished, we open the manifest again and we use this permission.
‫We add the user permission here uses permission.
‫Android camera.
‫And the second thing that we use is uses to use this feature.
‫And what is the feature?
‫Its Android name?
‫Heart.
‫Android Hardware camera.
‫And we put full
‫and this way we are ready to use our camera to to scan the QR code and we are using the ML kit barcode
‫scanning library in order to detect what this code has, have or has the information and what are the
‫links that may include inside this code.