Simple and to the point tutorial! everything was step and step and easy to understand even though i made my app in java, following this tutorial along with help of chatgpt made it super easy thanks very much!
if anyone has a problem with scanner_view not being recognized you can solve this pretty easily by inserting { id 'kotlin-android-extensions' } in the plugins section of the app build.gradle and then import on the mainactivity file { import kotlinx.android.synthetic.main.activity_main.* } Hope this helps someone
im trying to import the { import kotlinx.android.synthetic.main.activity_main.* } in to mainactivity, yet i can't get it to work. I get an error and the scanner is still not poping up in the activity_main file.
First, thank you for teaching this. This is really much appreciated. But I have a question. The scanner continuously scans barcodes. Example, I scan barcode A, and while the scanner is pointed at the code, it still keeps scanning. So, the scanner pointing at the barcode for 3 seconds results in dozens and dozens of scanning of the same barcode.. How can I make it so that after scanning a barcode once, the scanner stops? EDIT: I figured it out. What I did was this: Create two variables. newCode and prevCode. Scan the code. Assign the new code to newCode. if (newCode != prevCode), proceed. prevCode = newCode else, do something.
totaly new to android studio, your tutorial works perfectly! Can we send this variable throught bluetooth to populate any text box in windows like a keyboard insert? simply ?
Thanks for the tutorial. Very useful. But what if I want to display the dialog with camera permissions only first time when the app is installed? The next time Camera should already be allowed
Hey sei il migliore. I really enjoy your videos and you should do more kotlin tutorials. I just learned java and watching your videos kotlin makes so much more sense. Is there anyway to brighten the codescanner view? I have noticed that the camera preview is darker than my normal camera preview. You just gained a fan !!
Mi rende molto felice sentire che i miei video ti hanno aiutato a capire meglio come funzionano le cose :) Penso che puoi modificarlo nello XML file che lo contiene. Ma non sono troppo sicuro.
Welp, seems like Kotlin android extension was disabled later in 2020 and referencing activity xml elements to kt files is no longer possible :( Anyone have a way around this?
Love the the content, but can you help me out When I add the Code Scan View to Frame Layout it doesn't recognize it even after adding dependency. Thank you
Shame it uses a 3rd party code scanner instead of something like Google's. Yes, it looks like it works, but what else is that library importing or doing in the background? I don't have time to research it. As for the video, great job on the tutorial.
I tried this library, just found it on github but one thing i noticed, it is slow to scan, sometimes it takes 2 to 3 mins, unlike integration from other libraries, anyways nice video!
i tried making your code scanner in a fragment, can you help me find out why i am unable to scan in the fragment and also a way to make it working in a fragment
nice video, can you help me fix this problem "Camera initialization error: failed to connect to camera service using android studio kotin language" that's the error when opening the camer of my virtual device
hi thanks for the video, i could use some help. The code scanner line is not poping up nomater waht i do( this is literally my first time using Android Studio). Can anyone help me?
In the latest version of Android Studio textview.text = it.text comes back as an error, only expressions are allowed. I've tried copying the Kt code from Github DIrectly, but it uses Toast and .show actions that are not recognized as well. Total Newbie here. Any suggestions?
Hello, I'm kinda new to mobile development...and I have a concern that I'd like someone to explain to me please. My concern is this: I sometimes use applications capable of solving mathematical equations by simply filming on a notebook or a support (I am not interested in the mathematical part 😅) I would just like to know how and with which instruction (C#, .net ...I don't really know) we retrieve the equation written on the notebook through the camera... And I would also like to know if it's possible to create an application that communicates with offline software (like bluetooth...) thank you!
Hi can u plz help. I keep seeing a black screen when I go back and start the app again. I'm failing to understand what's wrong. This usually happens with higher android version. Thanks!
Oddly, I had to add kotlin-android-extensions before I was able to import or reference any view from the code. Oddly, because during it tells me to remove it and use the kotlin-parcelize plugin (Studio 4.2.1)
Thanks a lot, it worked. This application uses the phone's back camera. But I have to use a selfie (front) camera. Is it possible? How can I do? Please, Help me...
OK, I solved :) I added this code; integrator.addExtra("SCAN_MODE", "QR_CODE_MODE"); integrator.addExtra("SCAN_CAMERA_ID", 1); // front (selfie) camera integrator.addExtra("SCAN_CAMERA_ID", 0); // back camera
Can you please help me with this error MainActivity.xml = Unresolved reference: scanner_viewer. I already declare scanner_viewer on activity_main.xml. But it doesnt appear . Thanks in advance.
Doesn't work anymore. I've got A LOT of errors, compilation fails, references to the textView and scannerView are missing... Android Studio is really a PAIN IN THE A** and the WORST IDE ever made
Salve, bel video. Peccato che dia gli errori che molti utenti ti hanno chiesto di spioegare. Ma non so perche non hai risposto neppure a un' utente. Questo errore lo da anche a me "Unresolved reference: scanner_view :21) . Ho ricontrollato piu volte l' id e ho anche provato a cambiarlo sia nell activity_main che nel MainActivity, ma non cambia niente. L' errore rimane. Sarebbe bello sentire come si puo risolvere. Grazie e ancora complimenti
Ciao Giovanni! Scusa che non posso rispondere a tutte le domande... questo e' solo un hobby e devo lavorare per fare la mia vita qua a Copenaghen. Riguardando tuo errore, devi ricercare Kotlin Synthetics Deprecation su Google, perché adesso non possiamo più solo scrivere il "reference" senza Kotlin Synthetics, che e' stato deprecated. Grazie e buona giornata!
@@Indently Ciao e grazie per avermi risposto. Io ho provato piu volte a implementare il tuo codice ma non riesco a risolvere l' errore di cui ti ho parlato. Visto che tu hai implementato il codice potresti dirmi come risolverlo quando hai 2 minuti di tempo? Grazie ancora 👍💪
At 5:18 codeScanner = CodeScanner(context:this, scanner_view) I don't get scanner_view It shows it as an error This is my first ever android project, I could really use some help
Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA),[17] meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.
So android developers can't scan QR/barcodes easily in two lines of code without any libs? Can't find any tutorial which doesn't use some shitty libraries.
I hope you understand the complexity involved into breaking down images into to bytes, and converting them into some sort of format that our phone can understand. This library saves us a lot of time.
Just awesome, you saved an entire student project with this tutorial. 1 billion thanks!
i need u bro
Does this scanner needs internet
Simple and to the point tutorial!
everything was step and step and easy to understand
even though i made my app in java, following this tutorial along with help of chatgpt made it super easy
thanks very much!
The "Remeber to subscribe" barcode is so creative to do
if anyone has a problem with scanner_view not being recognized you can solve this pretty easily by inserting { id 'kotlin-android-extensions' } in the plugins section of the app build.gradle and then import on the mainactivity file { import kotlinx.android.synthetic.main.activity_main.* }
Hope this helps someone
It did, thank you very much!
im trying to import the { import kotlinx.android.synthetic.main.activity_main.* } in to mainactivity, yet i can't get it to work. I get an error and the scanner is still not poping up in the activity_main file.
@@arma3053 same
I try it but it doesn't work ?
@@arma3053 did you find a solution ?
Love it. Short and no BS tutorial as it should be 🐣
I did it the Java way for a larf... worked first time! Awesome tutorial, thank you
can show code?
Can you show the code?
share the code plz
Congrats..! Very good job! Thanks... Your Vtutorials are great with a very simple explanation! Keep up the good work!!! We support you!
Very happy to hear, thanks for the support!
Do this scanner needs internet??
First, thank you for teaching this. This is really much appreciated.
But I have a question. The scanner continuously scans barcodes. Example, I scan barcode A, and while the scanner is pointed at the code, it still keeps scanning. So, the scanner pointing at the barcode for 3 seconds results in dozens and dozens of scanning of the same barcode..
How can I make it so that after scanning a barcode once, the scanner stops?
EDIT:
I figured it out. What I did was this:
Create two variables. newCode and prevCode.
Scan the code.
Assign the new code to newCode.
if (newCode != prevCode), proceed.
prevCode = newCode
else, do something.
Hi dean can you upload a pic of your code and share it with us. Thank you
totaly new to android studio, your tutorial works perfectly! Can we send this variable throught bluetooth to populate any text box in windows like a keyboard insert? simply ?
Thanks for the tutorial. Very useful. But what if I want to display the dialog with camera permissions only first time when the app is installed? The next time Camera should already be allowed
Simple and Direct! Loved the tutorial.
Very helpful to fellow developers.
I tried to make the app, but had an error
Unresolved reference: scanner_view
Any sugestion ?
class MainActivity : AppCompatActivity() {
...
private lateinit var scanner_view: CodeScannerView
private lateinit var tv_textview: TextView
...
override fun onCreate(savedInstanceState: Bundle?) {
...
tv_textview = findViewById(R.id.tv_textview)
scanner_view = findViewById(R.id.scanner_view)
...
i have the same proble with you sir
you have to add xmlns:app="schemas.android.com/apk/res-auto" on top
@@littlenosydragon1754 thanks bro
@@littlenosydragon1754 Thank you - none of the other fixes listed were working for me!
Oh my God, thanks thanks thanks!!!!!!!! U give me solution that i seek for 3 days. THANKS!
Hey sei il migliore. I really enjoy your videos and you should do more kotlin tutorials. I just learned java and watching your videos kotlin makes so much more sense.
Is there anyway to brighten the codescanner view? I have noticed that the camera preview is darker than my normal camera preview.
You just gained a fan !!
Mi rende molto felice sentire che i miei video ti hanno aiutato a capire meglio come funzionano le cose :) Penso che puoi modificarlo nello XML file che lo contiene. Ma non sono troppo sicuro.
Thanks for the tutorial. However, the flash functionality doesn't seem to work on mine... can you help?
Thank You! It works well and fast. But only when my camera far from QR. Is it possible to adjust the distance?
Congratulations for this excellent video. Exactly what I needed! Bravo Bravo
i got error intv_tevtview and scanner_view what to do plzz tell
Welp, seems like Kotlin android extension was disabled later in 2020 and referencing activity xml elements to kt files is no longer possible :( Anyone have a way around this?
Amazing ! Now how can I get product informations from this scanned barcode. I saw few database API for this. But how to implement them ?
i have question how to make the scanner automatically go to the link that benn scanned in the app without showing url in the textview
can I use this in the latest android studio? it seems the code you are typing gets red in mine
Very straightforward! Thank you so much
Good video
Does the flashlight work?
If your phone has a flash light, it will work.
Love the the content, but can you help me out When I add the Code Scan View to Frame Layout it doesn't recognize it even after adding dependency. Thank you
Such a great tutorial. Thank you so much
Good Tutorial ! But I've got an issue : Unresolved reference: scanner_view.
Can you help me out? Thank you
My apologies it was my mistake. Awesome tutorial !
I have the same problem, what did you fix?
how did you fix it please help
@@movimientoenelespacio How did you fix it?
@@timminator555 have you find the error ?
How can I... Scan code QR and Load this Code Qr (URL) into WebView... or External Explorer...
??? Can U helpme??
hi in 2024 im adding this same feature to the app for my project!
Thanks a lot for this video. It's very helpful
thanks you for the tuto ! Why my cam is not working ? Instead of turn on my cam it takes the environment of the simulation ...
Is he doing it in Kotlin or Java? sorry I am new to this and am learning and don't want to follow the instructions incorrectly
He's using Kotlin
@@dxxxlan ty mate
Great video
wrong orientation for me. how do we resolved this?
Shame it uses a 3rd party code scanner instead of something like Google's. Yes, it looks like it works, but what else is that library importing or doing in the background? I don't have time to research it. As for the video, great job on the tutorial.
its opensource
I tried this library, just found it on github but one thing i noticed, it is slow to scan, sometimes it takes 2 to 3 mins, unlike integration from other libraries, anyways nice video!
Can i ask you i have problem whan i add the scanner view
Thanks bro, you're the best!
for me no errors but when i try running the apps no information appears on the screen. why?
working good tutorial
i tried making your code scanner in a fragment, can you help me find out why i am unable to scan in the fragment and also a way to make it working in a fragment
me to
nice video, can you help me fix this problem "Camera initialization error: failed to connect to camera service using android studio kotin language" that's the error when opening the camer of my virtual device
I am getting the same error, have you resolved it?
@@kartikmalhotra3551 me too, how can I?
@@inaayat4193 github code is incomplete watch the video and code, then it will work👍
@@kartikmalhotra3551 i succeeded, camera permissions should be enabled in settings
great work
Hey you.. Why my Android 8.1.0 Imin device, can't scan. please help me
hi thanks for the video, i could use some help. The code scanner line is not poping up nomater waht i do( this is literally my first time using Android Studio). Can anyone help me?
Can I use this on transferring activities when a QR code is scanned?
How i relate activity_main.xml and MainActovity.kt files?
This won't work for me. It keeps telling me I have unresolved references when referencing the ID's in the XML file
I am facing the same problem?
Have you got the answer?
@@guneshmunjal9995 nope
In the latest version of Android Studio textview.text = it.text comes back as an error, only expressions are allowed. I've tried copying the Kt code from Github DIrectly, but it uses Toast and .show actions that are not recognized as well. Total Newbie here. Any suggestions?
It doesn't work with me in xml the scanner view any help ?
Hello, I'm kinda new to mobile development...and I have a concern that I'd like someone to explain to me please. My concern is this: I sometimes use applications capable of solving mathematical equations by simply filming on a notebook or a support (I am not interested in the mathematical part 😅) I would just like to know how and with which instruction (C#, .net ...I don't really know) we retrieve the equation written on the notebook through the camera... And I would also like to know if it's possible to create an application that communicates with offline software (like bluetooth...) thank you!
hey dude how can i fix the unsolved reference scannerview and tv_textview?
Have you got the answer?
I am facing the same problem
same. do u fix?
osm brother thankyou so much
Hi can u plz help. I keep seeing a black screen when I go back and start the app again. I'm failing to understand what's wrong. This usually happens with higher android version. Thanks!
Read your error messages in the console
Great job
I am working on the Android 10 API 29 project but there is no Activity_main.xml. Any idea would be appreciated.
Thanks a lot !
AAPT: error: not well-formed (invalid token).
Oddly, I had to add kotlin-android-extensions before I was able to import or reference any view from the code. Oddly, because during it tells me to remove it and use the kotlin-parcelize plugin (Studio 4.2.1)
Whther this scanner needs internet??
how did you do it can you share with me , thank you
Hello!
I explain everything in the video.
Have a nice day!
Thanks a lot, it worked. This application uses the phone's back camera. But I have to use a selfie (front) camera. Is it possible? How can I do? Please, Help me...
OK, I solved :)
I added this code;
integrator.addExtra("SCAN_MODE", "QR_CODE_MODE");
integrator.addExtra("SCAN_CAMERA_ID", 1); // front (selfie) camera
integrator.addExtra("SCAN_CAMERA_ID", 0); // back camera
@@ahmetaykilic8119 Where did you add the code?
how to setupPermissions function in java please help
please help me on my error
AAPT: error: not well-formed (invalid token).
invalid token
I got an error at 5:17 it says scanner_view is unresolved reference what should i do please
@Rafif Rabbani yup thank you that was the error. i solved it
Can you please help me with this error MainActivity.xml = Unresolved reference: scanner_viewer. I already declare scanner_viewer on activity_main.xml. But it doesnt appear . Thanks in advance.
Add this to build.gradle under plugins
id ‘kotlin-android-extensions’
@@ponapple thanks mate!
@@ponapple thank you kind sir
@@ponapple It doesn'nt work. It also says Unsolved reference: tv_textView. And Variable expected in this line: tv_textView.text = it.text.
@@timminator555 it works for me, though.
What if I want to go to a new Activity after scanning a barcode (passing the value along with it) ? Help is appreciated.
It is the same process as sending a value to any new activity
The Code scanner in activy_main I can't find it
Hello, can you teach us how to scan only specific type of qr codes like whats app do
excelent!!
Thank you bro
np bro
Why does my id "scanner_view" need to add local variable or parameter even though I declare it in the activity main
did you solve the issue? please help me im stuck
If you're solved plz help me out.
THANK YOU BRO
If i scan a barcode an item has then will it show me its price??
If you program it to do so.
Doesn't work anymore. I've got A LOT of errors, compilation fails, references to the textView and scannerView are missing... Android Studio is really a PAIN IN THE A** and the WORST IDE ever made
flash light not working...why?
i cant view the QR code scanner PLSS help me
sir, how to save the details?
Use local storage or cloud database
@@Indently if using firebase how to implement in the code sir. Pls help me
Create unique user id and insert data
@@Indently sir u have any related video? So its easy for me to refer
How to clear the bug...
java.lang.RuntimeException: Failed to connect the camera service
With lots of love and research on Google
Bug fixed..❤️
How did you fixed it?
What Language did you use?
English 😐
Salve, bel video. Peccato che dia gli errori che molti utenti ti hanno chiesto di spioegare. Ma non so perche non hai risposto neppure a un' utente. Questo errore lo da anche a me "Unresolved reference: scanner_view :21) . Ho ricontrollato piu volte l' id e ho anche provato a cambiarlo sia nell activity_main che nel MainActivity, ma non cambia niente. L' errore rimane. Sarebbe bello sentire come si puo risolvere. Grazie e ancora complimenti
Ciao Giovanni!
Scusa che non posso rispondere a tutte le domande... questo e' solo un hobby e devo lavorare per fare la mia vita qua a Copenaghen.
Riguardando tuo errore, devi ricercare Kotlin Synthetics Deprecation su Google, perché adesso non possiamo più solo scrivere il "reference" senza Kotlin Synthetics, che e' stato deprecated.
Grazie e buona giornata!
@@Indently Ciao e grazie per avermi risposto. Io ho provato piu volte a implementare il tuo codice ma non riesco a risolvere l' errore di cui ti ho parlato. Visto che tu hai implementato il codice potresti dirmi come risolverlo quando hai 2 minuti di tempo? Grazie ancora 👍💪
@@Indently Scusa non avevo letto tutto il tuo messaggio. Grazie del suggerimento e buona giornata 😀
how can someone create dependency like that? I mean how all this works in the background?
Hi Shobhit, unfortunately I can't answer that. You would have to do a bit of research on Google for that.
duz it wrk with barcodes in supermarkets?
maybe, but maybe not
@@Indently why not?
@@54M1WUL No reason, or maybe there are many
@@Indently i wanted to make an app wher it can scan the barcodes of supernarket items, to see if the user has the correct budget
@@54M1WUL have you tried scanning a barcode?
Trying the Kotlin route in Android Studio I get Unresolved reference:int any ideas?
Resolved
I have the same error
What's the solution for this?
flash light not working
is there a java for this one? if there is, can someone help me? im not familiar with kotlin yet
do u have for java version?
yes
@@Indently can I get a copy?
Спасибо, только твой код помог 🙂 Но фонарик всё равно не работает
Is there code for scaning values like number
probably
Thank you
And recylerview image with text firebase
At 5:18
codeScanner = CodeScanner(context:this, scanner_view)
I don't get scanner_view
It shows it as an error
This is my first ever android project, I could really use some help
SOLUTION:
In build.gradle(.app)
Add another pluggin
id 'kotlin-android-extentions'
This should fix the issue
@@wiz8370 doens't fix the issue, idk why. I already checked the id on design, still red same with tv_textView
@@charliecliforddevilla7836 did you fix it? if yes i want to know how
How i can get custom barcode?
Type it in your search engine
this scanner can browse web link///??
sure
this code make the app scan any qr code
how can i make the app scan uniqe qr code ?!
Make the content of the QR code a secret code, and add an if/when statement that uses that code to display whatever you want to display
java tutorial?
No, I recommend learning Kotlin
hi in 2024 im making this project in java with help of chatgpt to trancode kotlin in this tutorial to java
Why can't we make payment ?
Payment to who?
Java?
Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA),[17] meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.
yeh i mean. i need tutorial for java. thanks.
W3school is a great place to learn Java: www.w3schools.com/java/
tutorial on java, how to implement this code scanner?
@@lzzpigeonclockingsystem7991 Ah, you should have said so earlier! Just learn Kotlin.
The best tutorial that deserve more likes. +1 subscribe for a Very useful tutorial 😍
So android developers can't scan QR/barcodes easily in two lines of code without any libs? Can't find any tutorial which doesn't use some shitty libraries.
I hope you understand the complexity involved into breaking down images into to bytes, and converting them into some sort of format that our phone can understand. This library saves us a lot of time.
@@Indently yup, I'm just from the swift world where everything is 100x times easier.
@@Indently ok, I implemented it with CameraX+ZXing and JetPack Compose.
please notice my comment Code Palace
camera black
^^~