Read NFC tag without specific application?

前端 未结 2 1788
星月不相逢
星月不相逢 2021-01-14 09:33

I was wondering if there is any way to save a string of text (URL) to an NFC tag, let us say MIFARE or NTAG203, that can be read by other devices (smartphones) without the n

2条回答
  •  日久生厌
    2021-01-14 09:56

    First of all, in general, I agree with CommonsWare point of view that it's always a "special" app that handles NFC events. However, when looking into Android, I would consider the various platform apps from AOSP as part of the Android system. Even though not all of them may be available on all devices.

    Looking into Andrid 4.4+, the following data types are handled by such system apps:

    • Browser: URIs with schemes "http:" and "https:".
    • Contacts and Dialer: MIME types "text/vcard" and "text/x-vcard" for importing contacts.
    • E-mail: URIs with scheme "mailto:"

    In addition, if no other app handles a certain tag, NFC devices should(?) have the Tag app, that tries to handle various types (upon user confirmation):

    • URIs with scheme "tel" will cause an ACTION_CALL intent to call the given number.
    • URIs with schemes "sms"/"smsto" will cause an ACTION_SENDTO intent to start editing an SMS message.
    • Other URIs should(?) be forwarded in ACTION_VIEW intents.
    • MIME type records with type "text/x-vcard" (if not already handled) should be forwarded in ACTION_VIEW intents.
    • The text message of Text RTD records (not text/* MIME types!) should be displayed in the Tag app. Unfortunately many stupid(!) NFC apps register for Text records, thus you will normally not get to the Tag app.
    • MIME type records with type image/* (if image type is supported by Android) should be displayed in the Tag app.

    Some records are handled by the NFC service itself (this should always be available on Android):

    • Android Application records (NFC Forum external type with type name "urn:nfc:ext:android.com:pkg") cause an ACTION_VIEW intent with the URI "market://details?id={PACKAGE_NAME}" to be sent.
    • NFC Forum external types with type name "urn:nfc:nokia.com:bt" are parsed for Bluetooth connection handover.
    • NDEF messages starting with a Handover Select RTD record and containing a MIME type record of type "application/vnd.bluetooth.ep.oob" are parsed for Bluetooth connection handover.

提交回复
热议问题