NFC tag size for launching application

966 Views Asked by At

New to the NFC concept, was wondering what size of tag I need (48, 144 or 454 bytes) for the "Launch application" tag option where you simply enter an app package to launch.

Say my package name is standard sized: xxx.xxxxxxxxxxxx.xxxxx

2

There are 2 best solutions below

0
Michael Roland On BEST ANSWER

For an Android Application Record (AAR) you will need the following amount of memory:

  • NDEF Header byte: 1 byte
  • NDEF type length field: 1 byte
  • NDEF payload length field: 1-4 bytes (typically 1 byte for this type of record)
  • NDEF type name "android.com:pkg" (external type): 15 bytes
  • AAR payload: length of package name in bytes when UTF-8 encoded. For your example of xxx.xxxxxxxxxxxx.xxxxx, this makes 22 bytes.

So the NDEF message (consisting only of the AAR) has 40 bytes (or possibly 43 bytes when using a 4 byte payload length field).

Once you know the size of your NDEF message, the rest depends on the tag type that you use. For instance, with an NFC Forum Type 2 tag (e.g. MIFARE Ultralight and NTAG), you have at least two more bytes of overhead:

  • NDEF TLV tag field: 1 byte
  • NDEF TLV length field: 1 byte

Moreover, many Type 2 tags contain a Memory Control TLV and/or a Lock Control TLV block (5 bytes each) within the user memory area.

Also note that some vendors refer to the overall tag size (which includes memory areas with tag meta data that cannot be used for actual NDEF data) instead of the available user memory.

1
ligi On

You can get away with 48 bytes. One common way is to have some URL on the tag - behind this URL you offer the app-install ( for the case the app is not installed yet ) - if the app is installed it is opening ( with an intent-filter for this URL ). When you find some url =< 48bytes that fit's your needs you should be able to go with 48byte-NFC-Cards