Unable to compile ... (Preverfiying Error!)
Hey,
I try to compile the following app with WTK 2.5.2 and both the SiritnFCControl:jar and the extension_jsr57_share.jar:
<code>
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package at.nfcresearch.benq;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import com.sirit.nfc.Hardware;
import javax.microedition.contactless.TargetListener;
import javax.microedition.contactless.TargetProperties;
/**
* @author Madlmayr
*/
public class BenqTester extends MIDlet implements CommandListener, TargetListener {
private Form form;
private Command exitCommand;
private Command openCMCommand;
private Command openAppCommand;
private StringItem str;
public BenqTester() {
exitCommand = new Command("Exit", Command.EXIT, 1);
openCMCommand = new Command("Open CM", Command.OK, 1);
openAppCommand = new Command("Open App", Command.OK, 1);
form = new Form("Benq Tester");
str = new StringItem("Test:", "x");
form.addCommand(openCMCommand);
form.addCommand(openAppCommand);
form.append(str);
form.addCommand(exitCommand);
form.append("Slots: " + System.getProperty("microedition.smartcardslots") + "\n");
form.setCommandListener(this);
}
public void startApp() {
setCurrentScreen(form);
Hardware.NFCRequestEnabledADD(true);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
Hardware.NFCRequestEnabledADD(false);
}
public void commandAction(Command cmd, Displayable arg1) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
/**
* Implementation of the Call-Back Function of the TargetListener
* @param targetProperties: Array of Targets found by the Phone
*
*/
public void targetDetected(TargetProperties[] targetProperties) {
// in case no targets found, exit the method
if (targetProperties.length == 0) {
return;
}
String temp = str.getText();
str.setText(temp + "x");
// show the UID of the first tag found
TargetProperties tmp = targetProperties[0];
displayAlert("UID read: " + tmp.getUid(), AlertType.INFO);
}
public static String arrayToHex(byte[] data) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < data.length; i++) {
String bs = Integer.toHexString(data[i] & 0xFF);
if (bs.length() == 1) {
sb.append(0);
}
sb.append(bs);
sb.append((i + 1) % 4 == 0 ? '\n' : ' ');
}
return sb.toString();
}
private void setCurrentScreen(Displayable display) {
Display.getDisplay(this).setCurrent(display);
}
private void displayAlert(String error, AlertType type) {
Alert err = new Alert(form.getTitle(), error, null, type);
Display.getDisplay(this).setCurrent(err, form);
}
}
</code>
And I do get a
Error preverifying class com.jblend.io.ndef.Protocol
java/lang/NoClassDefFoundError: com/jblend/io/ConnectionImplFactory
D:\Develop\research\J2ME\Benq_Test\nbproject\build-impl.xml:431: Preverification failed with error code 1.
BUILD FAILED (total time: 0 seconds)
Looks like the JARs is not complet ... could someone verify this?
Additionall: in the handbook it says, there is function for pause:
protected void pauseApp(){
Hardware.NFCPauseADD();
}
This is not included in my JARs either ....
Any feedback is appreciated.
Cheers, geri-m