简体   繁体   English

在我的应用中使用Zxing和Google Goggles

[英]Using Zxing and Google Goggles with my app

I have an app, i used this code to integrate zxing 我有一个应用程序,我使用此代码集成zxing

public Button.OnClickListener mScan = new Button.OnClickListener() {
    public void onClick(View v) {
        Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
        startActivityForResult(intent, 0);
        }
    };

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == 0) {
        if (resultCode == RESULT_OK) {
           String contents = intent.getStringExtra("SCAN_RESULT");
           String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
           // Handle successful scan
        } else if (resultCode == RESULT_CANCELED) {
            // Handle cancel
        }
    }

I have both zxing scanner as well as google goggles installed in my mobile phone. 我有zxing扫描仪以及安装在我手机上的谷歌护目镜。 When i start the app and try to scan, I get the option to choose either the barcode scanner or the goggle app. 当我启动应用程序并尝试扫描时,我可以选择条形码扫描仪或护目镜应用程序。 I thought, hey let's try and use the goggle app for doing other stuff as well like OCR. 我想,嘿,让我们尝试使用护目镜应用程序做其他事情,就像OCR一样。 I select the goggle option but the app does not have the take picture option within it. 我选择了护目镜选项,但应用程序中没有拍照选项。 How do I integrate goggles also with my app? 如何将护目镜与我的应用程序集成? with full functionality? 具有完整功能?

Unfortunately you can't. 不幸的是你不能。 Goggles will only provide the same core functionality as ZXing. Goggles只提供与ZXing相同的核心功能。 I've spent hours researching the same question. 我花了几个小时研究同样的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM