O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Bluetooth

Bluetooth is a well-known wireless communication standard and almost all phones embed a Bluetooth controller. In this recipe, we'll connect ourselves to a Bluetooth object and send/receive data from it.

Getting ready

To follow this recipe, create a new project called Bluetooth, and you'll need to deploy your application on a physical phone as the emulator doesn't support Bluetooth. Also, you'll need to bond your phone to the target Bluetooth device of your choice—using the Bluetooth Manager of Android—prior to launching the app.

How to do it...

Here are the steps to complete this recipe:

  1. Add using Android.Bluetooth and Java.Util at the top of your MainActivity class. In addition, you will need the Bluetooth permissions.
  2. Add the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required