实施条形码扫描仪

时间:2013-01-02 09:48:13

标签: android barcode-scanner

我正在开发一个应用程序,我必须使用条形码扫描器来扫描条形码,经过大量搜索,我得到了以下代码:

 Intent intent = new Intent("com.google.zxing.client.android.SCAN");

借助此代码,用户可以实施Zxing的条码扫描器,但我想实现条形码扫描器以编程方式,即不想要第三方应用程序。 我使用Integrating the ZXing library directly into my Android application链接制作独立条形码扫描程序但我不知道在制作core.jar后该怎么做 请帮我集成条码扫描器。 任何帮助将不胜感激.. 提前致谢

2 个答案:

答案 0 :(得分:1)

关注此链接。它会帮助你。我也使用此链接在我的应用程序中集成Zxing     http://www.jmanzano.es/blog/?p=244

答案 1 :(得分:1)

启动结果的活动,或者仅仅是方便代码:

IntentIntegrator integrator = new IntentIntegrator(yourActivity);
integrator.initiateScan();

并使用此方法接收结果:

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
  ...
}

有关更多信息,请参阅此链接:

http://code.google.com/p/zxing/wiki/ScanningViaIntent

相关问题