问题
So I'm working on a project, and I'm wondering if there is a way I can implement the barcode scanner into my android app? So it would go from my app, open the camera and take the "picture", get the info, and go back to my app with that info?
回答1:
Here is an example of a third-party library for scanning barcodes: https://github.com/zxing/zxing/wiki/Scanning-Via-Intent
回答2:
As I am not an experienced Android developer, I don't know if you can talk back and forth between applications due to sandboxing. However, there is a barcode scanner called zxing which is "an open-source, multi-format 1D/2D barcode image processing library implemented in Java. Our focus is on using the built-in camera on mobile phones to photograph and decode barcodes on the device, without communicating with a server."
Seems pretty solid, so I would recommend using that.
回答3:
Android has its own barcode api
http://android-developers.blogspot.com/2015/08/barcode-detection-in-google-play.html?linkId=16316033
https://search-codelabs.appspot.com/codelabs/bar-codes#1
回答4:
If you are more comfortable creating apps using App Inventor, there is a barcode module based off of the ZXing library: http://appinventor.googlelabs.com/learn/reference/components/other.html#BarcodeScanner
来源:https://stackoverflow.com/questions/2739550/android-is-there-a-way-to-implement-the-barcode-scanner-into-an-app