Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Hi, I'm trying to set up my app for printing in an Intermec printer, through BlueTooth. The problem I have is that I need to set up an insecure connection through the Android.Bluetooth.BluetoothDevice.CreateInsecureRfcommSocketToServiceRecord Method That method appears in the API Documentation (online and inside Xamarin), but when I try to use it inside my app, it underlines it in red, and says that Bluetooth.Device does not contain a definition for that, my question is, why is this happening? What can I do? Is it a library problem? Do I need to update something?
The BluetoothDevice.CreateInsecureRfcommSocketToServiceRecord(UUID) method was added in Android v2.3.3 (API-10). By default, projects reference Android v2.2 (API-8), which does not contain that method:
To change the TargetFrameworkVersion, within Visual Studio view your Project Properties, click on the Application tab, then set the Compile using Android version drop-down to API Level 10 (Android 2.3) or higher.
Within Xamarin Studio, view your Project Options. In the left-hand tree select Build > General; in the right-hand panel set the Target framework to Android 2.3 (Gingerbread) or later.