[英]Can not use Google Barcode scanner
我從https://github.com/googlesamples/android-vision嘗試了谷歌條碼閱讀器
此示例不起作用。 當我選擇屏幕時,它總是會檢測到
“沒有檢測到條形碼”
調試原因:
private boolean onTap(float rawX, float rawY) {
//TODO: use the tap position to select the barcode.
BarcodeGraphic graphic = mGraphicOverlay.getFirstGraphic();
Barcode barcode = null;
if (graphic != null) {
barcode = graphic.getBarcode();
if (barcode != null) {
Intent data = new Intent();
data.putExtra(BarcodeObject, barcode);
setResult(CommonStatusCodes.SUCCESS, data);
finish();
}
else {
Log.d(TAG, "barcode data is null");
}
}
else {
Log.d(TAG,"no barcode detected");
}
return barcode != null;
}
graphic
變量始終為Null
看圖像:
有誰遇到過這個問題? 你能告訴我怎么解決嗎? 非常感謝!
正如@ Vietnt134已經回答的那樣,Android Mobile Vision暫時被禁用。
你可以按照這個主題來了解是否有人知道: https : //github.com/googlesamples/android-vision/issues/98
人們對Google非常生氣。 我希望他們能很快解決這個問題
所以我是新手Android Mobile Vision,在新版Google Play服務(v9)中,由於該功能存在嚴重錯誤,他們暫時禁用了該功能,您可以在此處查看發行說明:
https://developers.google.com/android/guides/releases#may_2016_-_v90
只要沒有圖形添加到疊加層, getFirstGraphic
返回null; 在條形碼示例中,這是在幀中未檢測到條形碼的情況。
檢查barcodeDetector.isOperational()
是否返回false。 如果它返回錯誤,有幾分鍾,並且您沒有處於低存儲狀態,那么這很可能是因為當前的服務中斷。
更多細節可以在這里找到: https : //github.com/googlesamples/android-vision/issues/98我們將在解決后立即更新該問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.