The NFC Share example demonstrates the use of NFC stack and the AIW framework APIs for the communication between NFC enabled devices.
Click on the following link to download the example: NFCExample.zip
Click: browse to view the example code.
This example shows how two devices get paired using the NFC channel and share a file using the secondary bearer channel (for example, Bluetooth). Using the AIW framework, this example shows how to share a vCard or vCal from one device to other device.
Class summary:
CAiwServiceHandler
Start Easy setup service
Start Sharing vCard
Start Sharing vCal
Stop Easy setup
Help
Exit
Once the two NFC-enabled devices are held close together and the Start Easy setup option is selected, both the devices get paired for the first time. The Start sharing vCard selection sends the default vCard. The Start Sharing vCal selection sends the default vCal to the other NFC device in proximity, which can be confirmed by the message notification. The sharing can be stopped by selecting the Stop Easy setup service option.
You can build the example from your IDE or the command line.
If you use an IDE, import the nfcexample.pro
file of the example into your IDE, and
use the build command of the IDE.
The example builds executable called nfcshareexample.exe
in the standard locations.
After running the example application, the user is provided with menu options that are self-explanatory.
Note: The proximity of devices held together should be kept in mind to ensure proper communication because of the NFC antenna limitation. If the devices are not communicating properly, an asynchronous event failure notification is displayed.