×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    130

    Write url NDEF message to tag

    I am trying to write simple url to the tag, but always get "Unknown Service Type" message. What is wrong in the following code:


    NDEFRecordType ndefrtype =
    new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD, "urn:nfc:wkt:Sp");

    NDEFRecord urlRecordToWrite = new NDEFRecord(ndefrtype , null, "http://www.name.com".getBytes());

    NDEFMessage write_container = new NDEFMessage();

    write_container.appendRecord(urlRecordToWrite);

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Berlin
    Posts
    201

    Re: Write url NDEF message to tag


  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    130

    Re: Write url NDEF message to tag

    I want this link to be opened by phone web browser. So I don't want to create Push Registry autostart entries. But still phone can't recognise this record.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Location
    Berlin
    Posts
    201

    Re: Write url NDEF message to tag

    Connection to TAG open?
    TAG is empty (clean)?
    write one entry in this TAG and test now.

  5. #5
    Registered User
    Join Date
    Mar 2007
    Posts
    130

    Re: Write url NDEF message to tag

    Tag contains some data which were written by this code.

    I wrote same url from 6131 NFC phone "Send to tag" menu.
    There are some differences, tag which were wtitten with my MIDlet contains additional byte, which were not in phone written tag.

    I am afraid problem in that. But if so, could Nokia provide example how to write simple url to the tag. Or is anybody did it already.

  6. #6
    Registered User
    Join Date
    Oct 2006
    Location
    Berlin
    Posts
    201

    Re: Write url NDEF message to tag


  7. #7
    Nokia Developer Expert
    Join Date
    Dec 2003
    Posts
    113

    Re: Write url NDEF message to tag

    You are using the "urn:nfc:wkt:Sp" type, which means a Smart Poster. A Smart Poster includes an URL, *as well* as an optional image, a title, and some other stuff as well. It's contents are described in the Smart Poster specification, which you can download at http://nfc-forum.org/specs

    A plain URL can be written using the "urn:nfc:wkt:U" type, but then you can't add a title or anything else. The exact spec can also be downloaded from NFC Forum, but it's a lot simpler than Smart Poster. Didn't test the following example, but it should work...

    ...
    byte[] headerByte = { 0x00 }; // see URI specification for meanings for this
    byte[] urlBytes = "http://my.url".getBytes();

    NDEFRecord r = new NDEFRecord( new NDEFRecordType(NFC_FORUM_RTD,"urn:nfc:wkt:U"), null, null );
    r.appendPayload(headerByte);
    r.appendPayload(urlBytes);

    // Write the message
    ...

Similar Threads

  1. problem with 8310 to send a Service loading push message
    By Nokia_Archive in forum General Messaging
    Replies: 2
    Last Post: 2002-10-10, 08:38
  2. problem to send a service loading message push for 8310
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-05-06, 12:39
  3. Problem to send a service loading push message for 8310
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-05-06, 11:19
  4. Problem to send a service loadinfd push message for 8310
    By alinesimon in forum Smart Messaging
    Replies: 1
    Last Post: 2002-05-03, 10:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×