no yellow dots on scanner

78 views
Skip to first unread message

lucy

unread,
May 16, 2014, 11:05:24 AM5/16/14
to zx...@googlegroups.com
I am using Zxing on Google Glass. When I want to start my application, I can see the scanner but it doesn't have a yellow dots and doesn't do anything.

Here is my code.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.setPackage("com.google.zxing.client.android");
intent.putExtra("com.google.zxing.client.android.SCAN.SCAN_MODE","QR_CODE_MODE");
startActivityForResult(intent,0);

}

//when a QR code is read, it will send a result code
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode == 0 && resultCode == RESULT_OK){
String contents = data.getStringExtra("SCAN_RESULT");
Card card1 = new Card(this);
card1.setText(contents);
card1.setFootnote("zxing");
View card1View = card1.getView();
setContentView(card1View);
// setDisplayCard(card1);

}
super.onActivityResult(requestCode, resultCode, data);
}

How can I solve the problem

Sean Owen

unread,
May 16, 2014, 12:59:58 PM5/16/14
to zx...@googlegroups.com
The port to Glass doesn't draw dots, and it also doesn't respond to Intents in this way. Are you trying to get the normal Android app working? it might work a bit but I doubt entirely. I have no idea if drawing on the view works in the same way.

lucy

unread,
May 18, 2014, 9:44:22 AM5/18/14
to zx...@googlegroups.com
On Friday, May 16, 2014 6:59:58 PM UTC+2, Sean Owen wrote:
> The port to Glass doesn't draw dots, and it also doesn't respond to Intents in this way. Are you trying to get the normal Android app working? it might work a bit but I doubt entirely. I have no idea if drawing on the view works in the same way.

I am implementging a Google Glass Application.. what you mean by Intens doesn't work that way? Do you know any other way of implementing a barcode scanner on Google Glass?

Sean Owen

unread,
May 19, 2014, 2:24:40 AM5/19/14
to zx...@googlegroups.com
You are using Intents here. You are trying to invoke an app which is not meant for Glass.
Reply all
Reply to author
Forward
0 new messages