Novice
unread,Oct 26, 2011, 9:33:24 PM10/26/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zxing
Hello guys!
Disclaimer: I am new to Android programming, so please answer like you
would to your grandma :)
How can I simulate a successful barcode scan (for testing purposes) on
an emulator in Eclipse?
I have succeeded in setting up Zxing on the emulator (with the
IntentIntegrator.java and IntentResult.java files) and added some code
to capture the barcode number in a textView. This works well on my
phone.
I want to add a few lines of code that simulate a successful scan so I
can add some more functionality without having to test on my phone.
This is the Result handler I have in my main java file:
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
switch(requestCode) {
case IntentIntegrator.REQUEST_CODE: {
if (resultCode != RESULT_CANCELED) {
IntentResult scanResult =
IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (scanResult != null) {
String upc = scanResult.getContents();
//WHAT CODE CAN I ADD AND WHERE SO I CAN SEND THE PROGRAM DIRECTLY TO
THIS POINT
TextView tv = new TextView(this);
tv.setText(upc);
setContentView(tv);
}
}
break;
}
}
}