Home > Mobile >  NFC MifareUltralight write failure data format
NFC MifareUltralight write failure data format

Time:11-26

Rt, write the code as follows
 public static void writeTag (Tag Tag) {
MifareUltralight ultralight=MifareUltralight. Get (tag);
Try {
Ultralight. The connect ();
Ultralight. WritePage (4, "1". GetBytes (Charset. Class.forname (" utf-8 ")));
//ultralight. WritePage (5, "efgh" getBytes (Charset. Class.forname (" US - the ASCII ")));
//ultralight. WritePage (6, "ijkl" getBytes (Charset. Class.forname (" US - the ASCII ")));
//ultralight. WritePage (7, "mnop" getBytes (Charset. Class.forname (" US - the ASCII ")));
Ultralight. Close ();
} the catch (IOException e) {
The e (" NFC WRITE ERROR ", "IOException while closing MifareUltralight... ", e);
} the finally {
Try {
Ultralight. Close ();
} the catch (IOException e) {
The e (" NFC WRITE ERROR ", "IOException while closing MifareUltralight... ", e);
}
}
}

But one of the following implementation will generate abnormal:
 WRITE ERROR: IOException while closing MifareUltralight... 
Java. IO. IOException: Transceive failed
An android. NFC. TransceiveResult. GetResponseOrThrow (TransceiveResult. Java: 52)
An android. NFC. Tech. BasicTagTechnology. Transceive (BasicTagTechnology. Java: 151)
An android. NFC. Tech. MifareUltralight. WritePage (MifareUltralight. Java: 193)
At com. SSL. Hitpatrol. Utils. NfcMsgParser. WriteTag (NfcMsgParser. Java: 171)
At com. SSL. Hitpatrol. Activity. MainActivity $override. OnNewIntent (MainActivity. Java: 59)
At com. SSL. Hitpatrol. Activity. MainActivity $override. Access $dispatch (MainActivity. Java)
At com. SSL. Hitpatrol. Activity. MainActivity. OnNewIntent (MainActivity. Java: 0)
. An android app. Instrumentation. CallActivityOnNewIntent (1218) Instrumentation. Java:
. An android app. Instrumentation. CallActivityOnNewIntent (1230) Instrumentation. Java:
. An android app. ActivityThread. DeliverNewIntents (ActivityThread. Java: 2677)
. An android app. ActivityThread. PerformNewIntents (ActivityThread. Java: 2689)
. An android app. ActivityThread. HandleNewIntent (ActivityThread. Java: 2698)
. An android app. ActivityThread. Access the $1600 (178) ActivityThread. Java:
An android. App. ActivityThread $H.h andleMessage (ActivityThread. Java: 1542)
An android. OS. Handler. DispatchMessage (Handler. Java: 111)
. An android OS. Stars. Loop (194). Which Java:
. An android app. ActivityThread. Main (5637) ActivityThread. Java:
The at Java. Lang. Reflect. Method. Invoke (Native Method)
The at Java. Lang. Reflect. Method. Invoke (372) Method. The Java:
At com. Android. Internal. OS. $MethodAndArgsCaller ZygoteInit. Run (ZygoteInit. Java: 959)
At com. Android. Internal. OS. ZygoteInit. Main (ZygoteInit. Java: 754)


CodePudding user response:

Oneself the top

CodePudding user response:

How are you solved

CodePudding user response:

Is a written piece of lock

CodePudding user response:

How are you solve it, I also have the same problem
  • Related