虽然我已经阅读了很长一段时间的PHP和一些android问题,但我还是个新手来堆叠overflow。
我的问题是,如何从条形码扫描器获取数据(只有UPC码和图像),以便将其插入到MySQL表中?
我会自己解决MySQL表插入的问题,但这简直要了我的命!我对android应用程序还很陌生,但我下定决心要把我的想法付诸实践,并开始在市场上销售。到目前为止,多亏了我在他们的维基http://zxing.appspot.com/scan上看到的Zxing的网址,我才能够启动扫描仪
这会在我的应用程序中单击一个按钮来启动扫描仪。它可以读取并工作,但我不知道如何从结果中获取数据。
我上下翻阅了那篇文章...我知道我需要把代码插入到不同的地方,但是在那个文章页面上,把这个放到你的活动中是什么意思?
`public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
// handle scan result
}
// else continue with any other code you need in the method
...
}` 另外,我应该把这段代码放在哪里?
`IntentIntegrator integrator = new IntentIntegrator(yourActivity);
integrator.initiateScan();`发布于 2011-11-15 06:52:41
查看ZXing谷歌代码页面上的Scanning via Intent文章。有关如何处理ZXing扫描活动的返回值的信息
发布于 2012-03-10 00:26:41
IntentIntegrator integrator = new IntentIntegrator(yourActivity);
integrator.initiateScan();这些代码需要在你需要调用scanner的地方...例如,如果你有一个按钮,你可以把这一行放到它的OnClickListener中。
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
// handle scan result
}
// else continue with any other code you need in the method
...
}这个应该存在于你的应用程序中,作为一种方法...
https://stackoverflow.com/questions/8129017
复制相似问题