Testing NFC applications
Testing NFC applications on the BlackBerry Smartphone Simulator
Some BlackBerry smartphones are equipped for NFC. BlackBerry smartphones that support NFC can read a smart tag, a smart accessory or other NFC-enabled devices. NFC technology is designed to transfer small amounts of data over a short distance. The BlackBerry Smartphone Simulator simulates only insecure passive communication.
- Provide a URL where a user can retrieve more information about an advertisement on a smart poster, such as a movie or a coupon
- Provide pairing information for a Bluetooth accessory
- Provide identification information for a smart dock
To test an NFC application using the BlackBerry Smartphone Simulator, you also need the tools in the Open NFC package, available from SourceForge. The two tools, the NFC Simulator application and the Connection Center application, run on the same computer as the BlackBerry Smartphone Simulator.
You can download the package for the NFC Controller Simulator program from SourceForge at http://sourceforge.net/projects/open-nfc/files. If you are developing for BlackBerry Device Software 7.0, download the Core or PC edition of the NFC Controller Simulator version 4.2.3.
Setting up the NFC Controller Simulator
Run the NFC Controller Simulator application, from SourceForge, on your computer. You can use it to send signals as though it were an NFC card or token and test your BlackBerry smartphone application.
The NFC Controller Simulator program must run on the same computer as the BlackBerry Smartphone Simulator. You can download the package for the NFC Controller Simulator program from SourceForge at http://sourceforge.net/projects/open-nfc/files.
To install the NFC Controller Simulator application on your computer, see the instructions with the NFC Controller Simulator program.
Set the NFC parameters
- On the Simulate menu, click NFC Options.
Perform either of the following tasks:
Initialize NFC for the NFC Controller Simulator rather than a test board, whenever the BlackBerry Smartphone Simulator starts. This is identical to using the /nfcc-using-sim parameter at the command prompt.
Select the Use NFC Simulator, check box.
Specify location of the NFC Controller Simulator.
Entering a URI using this option does not take effect until the next time the BlackBerry Smartphone Simulator starts. Until it restarts, setting this option prevents all NFC communication between the BlackBerry Smartphone Simulator and the NFC Controller.
In the text box under NFC Controller URI, enter the URI for the NFC Simulator.
- On the Simulate menu, click Initialize NFC.
Command prompt parameters related to NFC
This parameter loads the NFC User Mode Driver when the BlackBerry Smartphone Simulator starts. This option is only necessary if your installation of the Java programming language has no NFC support.
This parameter loads the URI that points to a NFC simulator program or the evaluation board. The default value points to an evaluation board. You can set the value of the URI on the BlackBerry Smartphone Simulator.
This parameter defines whether you are using an NFC simulator application. By default, it is set to false, but when using an NFC simulator application, this value should be set to true. You can set this value on the BlackBerry Smartphone Simulator.
Test an NFC application
If you run the BlackBerry Smartphone Simulator from a batch file, remember that any % characters in the URL string must have an additional % sign, so a string such as /nfcc-uri=NFC%20Device%20%231 becomes /nfcc-uri-NFC%%20Device%%20%%231 in the batch file.
- Start the Connection Center.
- Start the NFC Controller Simulator.
- On older versions of the NFC Controller Simulator, on the NFC Device #1 menu, click Start.
- In the Connection Center, on the Global tab, click Service List to display a dialog box with a list of services.
- In the Connection Center, under NFC Controller (NFC HAL), right-click NFC Device #1 (on older versions of the application, the entry is called NFC Simulator).
- In the Connection Center, click Copy service URI.
- At the command prompt, start the BlackBerry Smartphone Simulator with the additional parameters /nfcc-using-sim=true and /nfcc-uri=<copied_URI_string>. If the URI contains spaces, enclose the entire URI in double quotation marks.
- If you use the /nfcc-uri command prompt parameter, skip to step 9. In the BlackBerry Smartphone Simulator, on the Simulate menu, click Initialize NFC. The NFC Controller Simulator presents a dialog box showing a set of protocols and another dialog box showing the defined objects.
In the NFC Controller Simulator, in the
NFC Object Manager window, perform one of the
Present an NFC card or token.
In the Object List, double-click the name of the NFC card or token.
Remove an NFC card or token.
Under the label NFC Device #1 Antenna, double-click the image.
- In the BlackBerry Smartphone Simulator, test the application.