条形码扫描应用程序



谁能帮我解决这个问题。我需要一个条形码扫描应用程序来扫描产品代码。我是新手。因此,请给我发送条形码扫描仪的源代码。

希望这有帮助:使用智星的安卓条码扫描器

你可以使用:zxing-android-embedded。

用法:

  1. 要启动扫描:

    new IntentIntegrator(this).initiateScan(); // this is the current Activity
    
  2. 要获得结果,请执行以下操作:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
        if (result != null) {
            if (result.getContents() != null) {
                String contents = result.getContents();
            }
        } else {
            super.onActivityResult(requestCode, resultCode, data);
        }
    }
    

您可以使用此链接进行条形码或QRCode扫描

访问 https://github.com/zxing/zxing/

最新更新