×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    8

    Reading second record on NFC tag

    Hi,

    I wrote a small test application using the NDEF Library for Proximity APIs / NFC in codeplex.

    I am writing 2 records into a tag (the first record is NdefUriRecord and the second is NdefTextRecord).
    When tapping the NFC tag, my test application starts (based on the scheme defined in the first record).

    However in order for my application to read the second record on the tag (after being started automatically), I have to move the tag away and re-tap otherwise the application will not read the tag second record.

    Is this a normal behavior? How can I overcome this issue?

    If anybody has another way to put 2 records on a tag, one custom URI to start the application and the other Text to have some JSON data (as text) please let me know.

    Thanks,
    Eitan

  2. #2
    Regular Contributor
    Join Date
    Aug 2012
    Location
    Rhine Valley
    Posts
    92

    Re: Reading second record on NFC tag

    You could put the text as Url parameter to the first record. Like "myapp:startapp?textparam={data:1234}".
    - <a href="http://www.dvlup.com/influencer/invite">Visit DVLUP and earn rewards</a>

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2010
    Posts
    6

    Re: Reading second record on NFC tag

    Unfortunately, WP only sends the contents of the URL record to the app when it is launched through a URI scheme. As you found out, you can only read the full NDEF message on the tag if your app is in the foreground and you tap the tag.

    As influencer proposed, you should put the usage data into the URL record. However, be careful with the data you store in the URL - only URL safe characters are allowed. You can not put binary data into the URL.

    Also here, the app and the NDEF library can correctly read URLs with binary content when they are in the foreground. But the URL contents will get messed up if they contain unsafe characters and the app is launched via the URL scheme.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    511

    Re: Reading second record on NFC tag

    Does Uri.EscapeUriString properly deal with the issue? You should be able to add (small amounts of) binary data that way if you use a Base64 encoding. I however don't know if that is really viable on NFC Tags.

Similar Threads

  1. Appending another byte array to the same record in a record store
    By cryptyritu in forum Mobile Java General
    Replies: 2
    Last Post: 2011-01-13, 07:48
  2. Mifare card keys for writing/reading NDEF record
    By jlanza in forum Near Field Communication
    Replies: 4
    Last Post: 2008-08-26, 14:55
  3. Is there any method for reading the entire record data at a time?
    By Sneha1 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-12-27, 05:56
  4. Problem in reading Record Store in s40
    By harshalpatil in forum Mobile Java General
    Replies: 1
    Last Post: 2007-05-22, 08:04
  5. Writing / Reading an int to RMS record
    By beyondtron@hotmail.com in forum Mobile Java General
    Replies: 2
    Last Post: 2004-12-17, 02:11

Posting Permissions

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