If you are developing an app on Windows 8.1 and you want to use Bluetooth (you can send and receive files via Bluetooth on Windows 8 as well, but if you are a developer and you want to create your own Bluetooth service, you can use the Bluetooth classes only in Windows 8.1) you may have experienced some troubles. Windows 8.1 has some security features included in a way that you have to set multiple paramteres before your Windows 8.1 apps can communicate. Here is a step-by-step instruction!
1. Pair your devices
Before you can send and receive data or see Bluetootg services offered by a device next to you, you must pair your device with the other device. Open the Windows 8.1 charms bar and click on “PC settings”. Click on “PC & devices” and then on “Bluetooth”. Click on the device you want to chat with and add the device. In this example, the name of our partner device is ASTORIA. Execute this step on your other device too.
If you don’t see your device in this list, be sure that both devices support Bluetooth and all drivers are installed correctly. Open the “Device Manager” and check the Bluetooth-entry. Is there a yellow warning sign icon on the entry? If so, your Bluetooth driver isn’t installed correctly. If there is no sign, try to deactivate and activate your driver or try to find a new version of the driver.
If you still can’t find your device, open the Bluetooth settings by clicking on the Bluetootg sign in the taskbar and check, if the device is visible for other devices by clicking on “Allow Bluetooth devices to find this computer”
By now you should be able to send and receive files over Bluetooth. If you are a developer and you are offerning your own Bluetooth service (like a Rfcomm chat) continue with the next step.
2. Add the service
If you have succesfully paired your devices (don’t worry if the “Not connected” mark appears next to the device after a short period, that’s ok) change to the control panel and search for “Devices and Printers”. Right click on the device you have just paired and click on settings.
Change to the “Services” tab and click on the name of the service, the other Bluetooth device is offering.
WARNING: The other device must broadcast the service while walking through step 2 on the own device, otherwise you won’t be able to see it in the Bluetooth-Services list. Simply call the RfcommServiceProvider.StartAdvertising method in your Windows 8.1 app on the other device. For more details how to do this, check out this post.
If you have followed these steps you should now be able to communicate via Bluetooth. You can now download a Bluetooth chat app like this one to test your connection or you can write your own. See this code sample and this documentation to learn more.
… is an author, software developer and consultant.
His areas of interest ranging from cloud computing and distributed systems over data analysis and machine learning.