hi , thanks for this tutorial. i want some help from you, how can i use this code scanner without display the camera view in screen (run the camera in the background). thank you!
Hi, if you'd like to customize the barcode scanner, then you might want to check out ML Kit for Android: developers.google.com/ml-kit/vision/barcode-scanning/android
Hi Sarah! How could you personalize the UI of the scan screen? Maybe not show "Scanned by Google on behalf of App", or change the look and feel.... I haven't yet found any info on it. I was guessing on the options variable you could change something else apart from the code format? Thanks in advance!
Hi, I believe that if you'd like to customize the Barcode Scanner, then you need to use ML Kit instead. I haven't used it yet, but it looks like it has a lot more options. Here's the link for more info: developers.google.com/ml-kit/vision/barcode-scanning/android
Hi Sarah! Is it possible to restrict what QR code you scan? I need to only scan a specific QR (one that goes to a speficic webpage) not just a certain type of code... I want to show a message "Not a valid QR code" while still on the scanning screen, like on top of it, right now it goes straight to the main screen :/
@@adrasanchezruiz437 Hi 😀How about a sheet that pops up maybe? Something like this might work for you?: github.com/googlesamples/mlkit/tree/master/android/material-showcase
Hi Sarah, I downloaded the code to run and study it, but it has an error in "Build file 'S:\gps-google-code-scanner-barcode-main\app\build.gradle.kts ' line: 4" UnsupportedClassVersionError Do you know what it could be?
Hi, what version of Android Studio are you using? I'm using Giraffe. I can try to open it in the version you're using & see if it's an IDE vs dependency issue...I'll also take a look at the code & see...
I was able to build from a fresh clone from my Git repo - I'm thinking it might be a Gradle issue. In libs.versions.toml, try downgrading the Android Gradle Plugin: com-android-application = "8.0.0", or even lower if you need to...like 7.4...
@@santansarah Hello Sarah, yes, looking calmly I realized that it was a different version of my IDE. I'm going to downgrade as you recommended and see if it works. Thank you very much.
Hi, thanks for the tutorial. I've downloaded and compiled your code, but when I try to scan, the preview is black. Is this perhaps an issue with my phone?
Hi, it could be - what type of phone do you have? I've had random issues using this barcode scanner - sometimes it works great; sometimes it doesn't. Are there any messages in Logcat? Maybe try to uninstall the app, then reboot your phone?
@@santansarah I have a ZenFone 9 with Android 13. I've sent the app to a friend and it behaved even weirder. On his phone it worked for the first time, but yesterday it kept crashing without even opening the scanning screen and uninstalling and rebooting didn't help. And for me, too, it doesn't open anymore (before I could see a black screen instead of camera preview, but with all other elements like the colorful lines). I haven't seen anything helpful in logcat and it seems like a different problem now since it's something that worked a few days ago on a different device, but now doesn't anymore. It's really weird.
@@puffypotato6536 OK, thanks for the info - I will do some research and check the code again; I think when I was having issues, it was on Android 13 too...
@@puffypotato6536 I just pushed an update to Git w/some Gradle mods that might help. I was able to test on Android 13 w/no crashes. I'm also using the Google Play Services Coroutines dependency to call .await(). Maybe this is causing some issues? You could try addOnSuccessListener instead...I added a comment in BarcodeScanner.kt w/the alternate code. Hope this helps!
Hi sarah, i am able to use google code scanner before. But now, it is failing and throwing an exception like com.google.mlkitexception and message was failed to scan the code. The thing is like, it didnt open camera at all .can you help me in this part
Hi, I'm so sorry - I missed this comment & I'm just seeing it now. I have seen a lot of bugs w/this. Did you try uninstalling the app? Were you able to get it to work?