NFC
Sharing a single local file or a URI
Here are the invocation attributes you use to invoke an NFC card to share a single local file or a URI:
Attribute | Value |
---|---|
Target ID |
sys.NFCViewer |
Action |
bb.action.SHARE |
URI |
Any valid URI value that is preceded by file:// (for example, file://, http://, https://) |
MIME type |
Any valid MIME type value, such as audio/mp3, image/jpg, and application/myfiletype |
Sharing a set of files or URIs
Here are the invocation attributes you use to invoke an NFC card to share a set of files or URIs:
Attribute | Value |
---|---|
Target ID |
sys.NFCViewer |
Action |
bb.action.SHARE |
URI |
filelist:// |
MIME type |
Any valid MIME type value, such as audio/mp3, image/jpg, and application/myfiletype |
Data |
Data can be sent in JSON format as a list of metadata in the following format: [{ "uri":<file-uri>, "type":<mime-type>, "data":<metadata> }] In the above code, the uri is the local path to the file, type is the MIME type for the specified file, and data is the associated metadata for the specified file (for example, thumbnail). |
Sharing text
Here are the invocation attributes you use to invoke an NFC card to share text:
Attribute | Value |
---|---|
Target ID |
sys.NFCViewer |
Action |
bb.action.SHARE |
MIME type |
text/plain |
Data |
Text is sent as a byte array. UTF-8 encoding is supported. |
Sharing NDEF messages
Here are the invocation attributes you use to invoke an NFC card to share NFC Data Exchange Format (NDEF) messages:
Attribute | Value |
---|---|
Target ID |
sys.NFCViewer |
Action |
bb.action.SHARE |
MIME type |
application/vnd.rim.nfc.ndef |
Data |
NDEF message is sent in the form of a byte array. The following method is used to create the byte array message: nfc_get_ndef_message_bytes(). |
Sharing URLs
Here are the invocation attributes you use to invoke an NFC card to share URLs, including remote files (for example, http://aa.mp3):
Attribute | Value |
---|---|
Target ID |
sys.NFCViewer |
Action |
bb.action.SHARE |
MIME type |
text/URI-list |
Data |
Data is sent as a URI to the remote file or link and must be URI encoded (for example, http://somesite/multi%20word%name.doc). |
Sharing data as a URL
Here are the invocation attributes you use to invoke an NFC card to share your application's custom data or share an image or a document as a URL:
Attribute | Value |
---|---|
Target ID |
sys.NFCViewer |
Action |
bb.action.SHARE |
MIME type |
MIME type can be specified in the following format: application/myapp, text/vCard. Make sure that the values specified are different from the MIME type values used to share text, NDEF messages, and URLs. |
Data |
Custom data is sent in Byte array form, specific to the application and MIME types mentioned above. |
Last modified: 2014-03-10
Got questions about leaving a comment? Get answers from our Disqus FAQ.
comments powered by Disqus