簡體   English   中英

使用Android Studio掃描Google Glass中的條形碼

[英]Scan the barcode in Google glass using Android Studio

我使用Android Studio作為IDE來開發Google Glass應用程序。

這是我正在使用的代碼:

Intent intent = new Intent(context, com.google.zxing.client.android.CaptureActivity.class);

但是它給出了錯誤,提示無法解析符號“ android”。

我添加了Gradle依賴項,如下所示:

compile 'com.google.zxing:core:2.3.0'

因此,我無法運行該項目。 請讓我知道可以解決此問題的方法。 另外,如果還有其他更好的選擇,請告訴我。

由於您僅包含ZXing核心,因此不會有任何ZXing的Android代碼。

看看BarcodeEye: https//github.com/BarcodeEye/BarcodeEye

如果通過Intent進行集成,則添加core不會執行任何操作。 您需要android-integration才能使用IntentIntegrator 如您所展示的那樣啟動Intent不太可行。 另外,您應該使用更新的版本-3.1.0,而不是2.3.0。 最后,您需要構建並安裝Glass應用程序,該應用程序位於glass/中的項目中。 我沒有使用Intent進行過測試,但是有人提到它可以工作嗎?

為了掃描條形碼,我正在使用zbar庫。 我已經下載了zbar.jar並將其添加到我的Android Studio項目的l​​ibs文件夾中,然后添加到了gradle依賴項中,例如:

dependencies {
    ....
    compile files('libs/zbar.jar')
} 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM