gpt4 book ai didi

android - Google Goggles 通过 IntentIntegrator 工作但没有 'Capture' 按钮

转载 作者:行者123 更新时间:2023-11-29 17:59:00 24 4
gpt4 key购买 nike

我做了一些研究(Stack Overflow 和网络),发现还有其他一些关于 Google Goggles 的问题以及将其与 Android 一起使用的可能性;通过一个 Intent 。我意识到它没有得到官方支持,我们都在等待 Google 开放 API 或为我们提供在我们的应用程序中轻松使用它的功能。

也就是说 - 如果有人可以提供帮助,我仍然想要一个答案/一些澄清?

引用这个问题:zxing intent "google goggles" doesn't recognize barcodes

有人回答说 Google Goggles 确实解码条形码,确实如此......所以在我的应用程序中,我通过 IntentIntegrator 调用最新版本的 Google Goggles 应用程序:

https://code.google.com/p/zxing/wiki/ScanningViaIntent https://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java

这个通过 IntentIntegrator 的调用成功地以扫描模式(某种)打开了 Google Goggles,但是 UI 上没有显示“捕获”按钮,它是隐藏的/不可用的...所以无法拍摄/捕获任何图像,以查看对我的应用程序的回调是否有效。

所以我的想法是:

  • 由于我调用打开 Google Goggles 的方式,这不受支持并且按钮被禁用?
  • 我打电话的方式有问题吗?
  • 最新版本的 Google Goggles 禁用了以前版本中提供的这项功能?
  • 其他?

下面是我如何调用以打开 Google Goggles 的代码示例。还包括另一种做同样事情的方法,但注释掉以供引用。

    // Try and open Google Goggles for scanning
try{

IntentIntegrator integrator = new IntentIntegrator(getSupportActivity());
integrator.initiateScan(IntentIntegrator.TARGET_ALL_KNOWN);

//Intent intent = new Intent("com.google.zxing.client.android.SCAN");
//intent.setPackage("com.google.android.apps.unveil");
//startActivity(intent);

}catch(Exception e){
Log.e(ScanFragment.class.getName(), "onViewCreated > Error creating scan Intent to Google Goggles: " + e.getMessage());
}
//>

如果您能提供更多帮助,我们将不胜感激;谢谢。

//狂野风格

最佳答案

是的,我实际上不确定 Goggles 是否再支持此 Intent。它不在默认定位的应用程序列表中。因此,如果您使用 IntentIntegrator,我认为您不会打开 Goggles;您正在打开其中一个条码扫描器应用程序。它们没有捕获按钮,您只需将条形码放入 View 即可。

如果它真的打开了 Goggles,可能它之前被设置为这个 Intent 的默认值,并且它具有优先权。尝试在“设置”中清除应用程序处理程序关联。

关于android - Google Goggles 通过 IntentIntegrator 工作但没有 'Capture' 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17313850/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com