Тёмный

Use Google Code Scanner for Android to Scan Barcodes in your Jetpack Compose Apps 

Sarah Brenner
Подписаться 1,2 тыс.
Просмотров 3,8 тыс.
50% 1

Опубликовано:

 

16 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@StampitisDP
@StampitisDP 4 месяца назад
Can it display more than just numbers once scanned?
@ouzerisoheib5155
@ouzerisoheib5155 Год назад
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!
@santansarah
@santansarah Год назад
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
@aliahmad94523
@aliahmad94523 Год назад
❤Thankful
@stonedcodingtom9097
@stonedcodingtom9097 11 месяцев назад
Can i edit design in some way?
@adrasanchezruiz437
@adrasanchezruiz437 Год назад
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!
@santansarah
@santansarah Год назад
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
@adrasanchezruiz437
@adrasanchezruiz437 Год назад
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 :/
@santansarah
@santansarah Год назад
@@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
@santansarah
@santansarah Год назад
Also - you may want to search for 'custom camera android'...this might help...
@leonidas_30052
@leonidas_30052 Год назад
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?
@santansarah
@santansarah Год назад
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...
@santansarah
@santansarah Год назад
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...
@leonidas_30052
@leonidas_30052 Год назад
@@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.
@puffypotato6536
@puffypotato6536 Год назад
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?
@santansarah
@santansarah Год назад
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?
@puffypotato6536
@puffypotato6536 Год назад
@@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.
@santansarah
@santansarah Год назад
@@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...
@santansarah
@santansarah Год назад
@@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!
@henrik908
@henrik908 5 месяцев назад
Thanks granny
@hemanthbotu9620
@hemanthbotu9620 Год назад
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
@santansarah
@santansarah Год назад
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?
Далее
Clean Theming in Compose (You're Doing It Wrong!)
10:43
The perfect imperfection of Google's Material You
15:47
Lazy layouts in Compose
24:32
Просмотров 92 тыс.
Hack your brain with Obsidian.md
11:53
Просмотров 1,9 млн
Let's Migrate an XML Project to Jetpack Compose!
15:49