Hallo ant.pitel,

Originally Posted by
ant.pitel
I'm trying also to start the Midlet with my Tag, but I don't understand how to format a Tag in MIME format and which data corresponding to my Midlet I have to write in it...
Here's my code for writing my tag :
[...]
NDEFRecordType myType = new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD,"urn:nfc:wkt:T");
NDEFRecord myRec;
myRec = new NDEFRecord(myType, null, data);
NDEFRecord[] myRecArray = new NDEFRecord[] {myRec };
NDEFMessage myMessage = new NDEFMessage(myRecArray);
conn.writeNDEF(myMessage);
The NFC Forum Well-known type urn:nfc:wkt:T (Text Record) and the MIME type text/plain are two different things. Therefore, you can either base your application on the Text record or on the text/plain MIME type.
For the Forum type Text Record, your PushRegistry entry would look something like this:
Code:
MIDlet-Push-1: ndef:rtd?name=urn:nfc:wkt:T,your.MIDlet,*
You can then register an NDEFRecordListener for this NDEF record type in your application:
Code:
dm.addNDEFRecordListener(this, new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD, "urn:nfc:wkt:T");
This should work for the NDEF message that you create with your code.
For the MIME type text/plain, your PushRegistry entry would look something like this:
Code:
MIDlet-Push-1: ndef:mime?name=text/plain,your.MIDlet,*
You can then register an NDEFRecordListener for this NDEF record type in your application:
Code:
dm.addNDEFRecordListener(this, new NDEFRecordType(NDEFRecordType.MIME, "text/plain");
br,
Michael