Windows Phone 8: NFC transmission in the simulator

Source: Internet
Author: User

Directory

  • 1. Configuration
  • 2. Code

 

Returned directory
1. Configuration

Implement analog NFC transmission in two WP8 simulators, such:

 

As we all know, the WP8 simulator does not support analog NFC, Bluetooth and WiFi direct transmission (WP8 system does not support WiFi direct at all ). The msdn document mentions a small tool that can simulate NFC transmission: proximity tapper.

 

To use this tool, you must first run multiple simulators in Visual Studio. Visual Studio does not support multiple instances of the same simulator, therefore, you need to deploy the program and run it in a simulator with different names:

 

Run proximity tapper. Note that the firewall cannot block proximity tapper. If there is no problem, the running simulator instance will appear in the device list in proximity tapper, and the background color is green:

 

Then, select the two simulator instances to be connected by NFC and click "tap selected devices and remain connected". Then, the two simulator instances are connected successfully, and the new connection is displayed on the lower side, you can also use proximity tapper to disconnect or manually send data. The right side is the data transmission status in the connection, such:

 

After both simulators run the current program, after the connection is established, both programs will prompt "connection successful", and then NFC transmission can be performed. Of course, the program is just an example, it transmits simple text.

 

 

Returned directory
2. Code

Windows 8 and Windows Phone 8 use the same winrt API for device proximity sensing transmission. All types are stored in the windows. Networking. Proximity namespace. There are two methods for NFC transmission.

One is through the peerfinder type, and the other is through the proximitydevice type:

 

Proximitydevice is easier to implement, while peerfinder is similar to socket.

In this example, proximitydevice is used for implementation. For the peerfinder NFC communication implementation, refer to Nokia's official NFC chat project. (Of course, compared with Nokia's NFC chat, the sample program in this article is simply weak .)

 

 

Source code download
Download Page
Note: the link is the Microsoft SkyDrive page. When downloading, use a browser to download it directly. Some download tools may not be available for downloading.
Source code environment: Microsoft Visual Studio express 2012 for Windows Phone

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.