I am writing an application for read the mifare card,but when I pass the APDU the error occur that on emulator "java.lang.nullpointerexception".I have successfully detect the ISO14443_CARD after that I pass the APDU like
if (tp.hasTargetType(TargetType.ISO14443_CARD)){
form.append("Target is ISO14443_CARD
");
try {
static byte[] APDU_AUTH1 = { (byte) 0xff, (byte) 0x86, (byte) 0x00, (byte) 0x00, (byte) 0x05,(byte)0x01,(byte)0x00,(byte)0xfc,(byte)0x60,(byte)0x00};
static byte[] STATUS_BYTE = {(byte)0x90,(byte)0x00};
if(STATUS_BYTE == iso14443.exchangeData(APDU_LOAD_KEY))
{
String value1 = new String("Hai!");
textfield1.setString(value1);
form.append(textfield1);
}
else
{
String value1 = new String("Hello!");
textfield1.setString(value1);
form.append(textfield1);
}
}
catch (Exception ex) {
form.append(ex.toString());
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…