The startScanFromFragment method of Scan Kit cannot be called as expected - android

I have developed a logistics app, which needs to scan barcodes on parcels frequently. I've tried integrating ZXing to implement the barcode scanning function, but it cannot recognize barcodes accurately in some scenarios including strong light, bending, and deformation... Now, I've integrated HUAWEI Scan Kit, but its startScanFromFragment(Fragment f, int code, HmsSanAnalyzerOptions o) method does not work. Because fragment that I'm using inherits from androidx.fragment.app. What should I do? Plz give me some points.

The fragment parameter in startScanFromFragment is android.native.fragment. However, the android.native.fragment API is about to be deprecated and will not be included in the Scan Kit API Reference. You are advised to use the startScan(Activity a, int code, HmsSanAnalyzerOptions o) method for barcode scanning.
In addition, Scan Kit provides four integration modes: Default View, Customized View, Bitmap, and MultiProcessor. Scan Kit is able to accurately and quickly scan barcodes from a long distance, in challenging scenarios, and no matter how the barcode is oriented.
To learn more, please visit HUAWEI Scan Kit.

I am unaware of the use of Fragments with the Scan Kit. It would be very nice to have some context because I could not find any documentation about it.
However, the Scan Kit should be exactly what you are looking for your use case. To my knowledge there are three different ways on how to implement it. The Default View Mode is the easiest implementation, with the Customized View Mode you are able to change the UI of the scanning process and the Bitmap Mode lets you completely customize the scanning process.
My assumption is that either the Default or Customized View Mode will be sufficient for your logistics app.
What should I do? Plz give me some points.
Above I linked you all the available Codelabs for the Scan Kit as they give you a nice step by step guide on how to integrate its different modes. If you need a Kotlin version of the guide, you can find them on this page next to Java versions.

Related

Adding Bluetooth Low Energy to android app with Kotlin

So, I've created an app and I want to be able to Add bluetooth devices to it (BLE or not). After I've added them, i want to display them in a different activity. I've looked for lots of tutorials(Stackoverflow and others) but couldnt find something specific.
I am a beginner and i used Kotlin to create the app.
Not exactly sure what you're looking for, but perhaps this SensorTag sample app is a simple enough example of what you're looking to accomplish?
It relies on Kotlin Coroutines to scan for nearby SensorTags, then allows you to select one, which navigates you to another Activity and connects to it, then displays sensor data.
I would like to recommend to use the rxJava for the BLE Scanning. For scanning the tags for forground and background working fine '
For view the demo on github rxAndroidBle_github_demo
on this library handled all exception.
I hope this will work for you !

fast mobile QR-code to only save a UUID

I need a barcode scanner for my mobile apps which works really fast and also with bad lightning conditions. As I only need to store UUIDs and not complete URLs etc., I guess there should be a possibility to limit the value range and therefore make the QR codes better recognizable. Is there a format which supports this?
I also find the WhatsApp QR-Code scanner very fast but I didn't find what they are using exactly...
One introduction might be this blogpost. It's based on Google's mobile vision api under the namespace com.google.android.gms.vision.barcode. It's fast, robust and easy to work with.
And I would also up the error correction level of the generated QR-codes if possible... But try the project linked in the blogpost first to see if you even need to.
You can use this library barcodescanner
With bad lightning conditions you can activate the flash, in the library there is all about it.

Scan multiple barcodes with ZXing

I am currently trying to get ZXing to scan some barcodes. It's doing that job fine so far (via intent).
Now I would like to make it decode multiple barcodes at once (they are placed beneath each other) without having to scan each barcode individually.
Is this even possible via intent? If not, a short example of how to do it the other way would be appreciated :)
I've so far only found a pretty old thread where a user requested this feature and some developers seem to have integrated it. However, I am unable to find any tutorial explaining the utilization.
The thread can be found here.
It's not possible by Intent, but it is certainly possible within the project. You would have to write your own scanning component, then use the core library's support (which you've found) to find multiple barcodes and do something with them.

How to do NFC(Near Field Communication) in android

I just want to scan details from my bussiness card through NFC into my native app(like address,name,company name) programmatically. I dont have much idea on this.What are the necessary steps i need to set up?How could i begin to do this app in android?
And one more,QR scanner is something different from NFC?
Thanks.
Broadly speaking NFC is a radio communication technology while QR is a image communication technology, so although they have some things like channel coding in common, they are available in mobile phones through quite different APIs.
In terms of functionally, NFC has more features than QR, but QR can be made to work on more devices (at this point in time).
I've actually made an app which supports both NFC and QR. You can get yourself started using the NFC Eclipse plugin (by yours truly) and XZing.
NFC Android Guide: http://developer.android.com/guide/topics/connectivity/nfc/index.html
QRCode is a 2-dimensional barcode. ZXing is an open-source, multi-format 1D/2D barcode image processing library.
Barcodes are different from NFC Tags.
If you're working on NFC, the basic things you'll need is an NFC enabled phone and a tag.. I hope you're aware of this.. Secondly, you should go through this link here. It gives you a basic idea of what NFC is and you can build on that.. Everything you want to know about Android NFC has been described there.
As far as QR is concerned, it's not the same as NFC.. But one thing I'd like to say here is that using QR for a project over NFC would bring down the cost since QR doesn't need extra hardware support like NFC does. But if you want to do something new, then NFC could be "the thing" you're searching for.
Hope this answers your question. If you're looking for something more, then please mention that too so that I can edit my answer later on..

Reading barcodes with android

Hi I am developing an application for the android htc hero. I am looking into ways of using the inbuilt camer to read 2D barcodes and extract the string returned from the barcode. I have only recently begun working with the android sdk but I do have a programming background from working on projects with java. I am curious to know what the best way to read the 2D barcode would be. I have some sample applications that read the barcode but they are all .apk files and have no source or library that i can work with. to give you a better idea of what i am trying to accomplish this site allows the generation of 2d barcodes made up of the data you desire here
Any replies would be greatly appreciated.
Android programs can interact with eachother using intents. Intents are a little like remote procedure calls: you ask the other program for a certain action (e.g. scan a barcode) and the other program will perform this task for you. The result is returned when the task is complete.
If the user has installed the ZXing Barcode Scanner, you can just use an intent to scan a barcode. The Barcode Scanner will then start, let the user scan the code and return the result to you.
More information about this scanner can be found on the Google Code page of this project: http://code.google.com/p/zxing/wiki/ScanningViaIntent
I'd look at this open source Android project: http://code.google.com/p/zxing/
For fellow Google search travelers, there is a 2012 post on the android developers blog on how to use intents with the example of barcode scanning :
http://android-developers.blogspot.com/2012/02/share-with-intents.html
As far as I know for decoding barcodes (apart from the algorithm) you need to know the (relative) widths of white and black bars. For that, you would have to rotate the barcode to a horizontal position and then detect the widths.
(Ok, the ZXIng stuff advised by others outperforms this manual hacking)

Categories

Resources