Android Question NFC Tags - get max write size for tag

Discussion in 'Android Questions' started by Jmu5667, Jul 29, 2015.

  1. Jmu5667

    Jmu5667 Well-Known Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

    You can get the raw data with NdefRecord.GetPayload.

    The size is NdefRecord.GetPayload.Length.
     
  3. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Hi Erel

    Thanks for the reply. That it not exactly what I am looking for. I need to know the maximum about that I can write to the tag from the phone.
    Using the NXP TagInfo app I can see the following:

    upload_2015-7-29_15-26-50.png

    This is my log info from a scan of the above tag:

    ** Activity (main) Pause, UserClosed = false **
    ** Activity (main) Resume **
    07/29/2015 15:32:27.208 - main, NFC_getID(), TAG ID 046514B2392B84, [B@41bc5450
    ' // recoding data to local SQL DB
    07/29/2015 15:32:27.225 - mod_nfc_data(), nfc_write_data, data ={public_id=2904, tag_id=046514B2392B84, scan_date=2015/07/29 15:32:27, delivered=-1, id=1438180347213}

    07/29/2015 15:32:27.228 - main, NFC_Read(), record(s) 1
    07/29/2015 15:32:27.231 - main, NFC_Read(), Record Text :This is a Test Message
    07/29/2015 15:32:27.240 - main, NFC_Read(), Storage Size :25

    The storage size should be 144 bytes I would have thought. I have about 4 of these tags and each has a different message so the store size bases on NdefRecord.GetPayload.Length is different.

    Regards

    John.
     
  4. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Just as to what I am doing

    App records tag swips and sends it to an receiver over TCP/IP and gets stored in a SQL DB. The user can leave messages for other users .ie. Security Guards doing their patrols or other staff members.

    I need to be able to get the allowable message length on the app of the maximum that the tag can receive. At present is it text only.

    This is a real world system.

    Regards

    John.
     
    Last edited: Jul 29, 2015
Loading...