hey,

I'm currentle trying to develop an application on a nokia 6212. This aplication should read a 2D barcode when finished but i'm having some trouble using the VirtualTagConnector. The application is throwing an exception while making a VisualTag connection. The code is as I included here or at least the function which uses it is.

these are the imported library's used in the code

import java.io.IOException;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.contactless.ContactlessException;
import javax.microedition.contactless.visual.*;


and the function is as stated below:

[I]public String readVisualTag() {

boolean supported = true;
String mySymbology ="data-matrix";
String dataout = "Not supported";

try {
Check that needed symbology is supported for reading
String[] symbologies = SymbologyManager.getReadSymbologies();
for (int i=0; i<symbologies.length; i++) {
if (symbologies.equals(mySymbology)) {
supported = true;
break;
}
}
if (supported) {
// Get supported image classes
Class[] images = SymbologyManager.getImageClasses();
// Read visual tag
VisualTagConnection conn = (VisualTagConnection)Connector.open("vtag://"); byte[] data = conn.readVisualTag(image, null , mySymbology);
//putting the data in a string
dataout = new String(data);
// Handle data from the image
conn.close();

}
else {
System.out.println("Symbology not supported for reading");
}

}
catch (IOException ioe) {
message1="InptOutputException";
message2=ioe.getMessage();
}
catch (VisualTagCodingException ce) {
message1="VisualTagCodingException";
message2=ce.getMessage();
}
return dataout;
}


the exception occurs on the line that I colored in red. I have no idea why but it throws an IOException while debugging.
If anyone got an idea why that is or how it can be solved, plz let me know. Al help is welcome.
Thank you in advance for the effort of at least reading this.