Incorporating NFC in your application
Near field communication (NFC) technology is a short-range, wireless technology designed to allow users to quickly exchange information between their BlackBerry device and smart tags, smart accessories, and other NFC-enabled devices. For example, users can share contact information such as their BlackBerry PINs, documents, URLs, or media such as photos, music, and videos.
BlackBerry users exchange information by tapping or aligning the back of their BlackBerry device with a smart tag, terminal, or another BlackBerry device.
- Try to provide users with an implicit way and an explicit way to exchange information using NFC. For example, allow users to tap their BlackBerry device to implicitly exchange information or click an item in the application menu to explicitly exchange information. At a minimum, if a Send or Share item already appears in the application menu, include a submenu item to allow users to exchange information by clicking the item in the submenu (for example, "Send" > "Tag").
- When a transaction is successful, the BlackBerry device vibrates automatically. Make sure that any information that is exchanged displays on the screen and that your application plays the NFC success sound (unless users have turned off the sound option).
- If a transaction is unsuccessful, make sure that your application displays a dialog box to notify users and plays the NFC failure sound (unless users have turned off the sound option).
- If information is transferred using Simple NDEF Exchange Protocol (SNEP) and a transaction takes longer than 2 seconds to complete, present users with a visual indication that the transaction is in progress. This approach lets users know that information is still being exchanged.
- If an SNEP transfer is larger than 40 KB, consider using Bluetooth to transfer the information instead. Since transferring 40 KB using SNEP takes approximately 20 seconds to complete, this is the maximum amount of time that you should expect users to hold their BlackBerry device and wait for a transfer.
- Store files in the appropriate location, based on the file type. For example, store pictures in the Picture Library. If you cannot determine an appropriate location, store files on the media card (Media Card/BlackBerry/documents). If the BlackBerry device does not have a media card, store files in Device/home/user/documents. If the BlackBerry device does not have built-in storage, then files must be stored on a media card.